Hi Nomad Community,
I’m running into a persistent issue with Consul DNS resolution from within a Nomad job container, even though resolution works perfectly fine directly on the host node. I’d appreciate any insights.
Setup:
- Environment: Single Nomad (v1.9.7 client/server) + Consul (v1.20.5 agent) node on RHEL 8.10.
- Nomad Networking: Jobs use
network { mode = "bridge" }
with CNI plugins (v1.4.1). - Host DNS:
systemd-resolved
configured for Consul (/etc/resolv.conf
→127.0.0.53
;resolved.conf
hasDNS=127.0.0.1
,Domains=~consul
,DNSStubListener=no
). - Consul DNS: Consul agent configured (
client_addr = "0.0.0.0"
,ports { dns = 53 }
) and verified listening on port 53.
Jobs:
I have two Nomad jobs representing typical microservices:
backend-job
: Backend service (e.g., Java JAR in Dockerbackend-image:1.0
), usesprovider = "consul"
, static port 8082.frontend-job
: Frontend service (e.g., Java JAR in Dockerfrontend-image:1.0
), usesprovider = "consul"
, static port 8080. Needs to contact the backend via Consul DNS.