: Container fails Consul DNS resolution despite working host resolution (Nomad Bridge + RHEL 8 + systemd-resolved)

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.conf127.0.0.53 ; resolved.conf has DNS=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:

  1. backend-job : Backend service (e.g., Java JAR in Docker backend-image:1.0 ), uses provider = "consul" , static port 8082.
  2. frontend-job : Frontend service (e.g., Java JAR in Docker frontend-image:1.0 ), uses provider = "consul" , static port 8080. Needs to contact the backend via Consul DNS.