Doman resolve problem in Azure

helllo,

I changed the OS from Ubuntu 16.04 to 20.04, and changed the DNS port from 53 to 8600, and created a new image in Azure.

When I run the job in Nomad I see the following error in the container logs.

org.springframework.cloud.consul.config.ConsulPropertySources$PropertySourceNotFoundException: com.ecwid.consul.transport.TransportException: java.net.UnknownHostException: consul.service.consul: Name does not resolve

What should I change in Nomad or Consul configs to use 8600 as a default port? Or do you have any other suggestions?

Hi @serxansherif,

Are you using the GitHub - hashicorp/learn-nomad-cluster-setup: Companion repo for the HashiCorp tutorial collection on Nomad cluster setup repository as your base?

If yes, I have PR against that repository with many changes, one of which deals with making the DNS work with Docker containers with systemd-resolved. Would you like to try it out?

ref: Refactor Nomad Cluster Setup by Ranjandas · Pull Request #26 · hashicorp/learn-nomad-cluster-setup · GitHub

With this PR, all you have to do is to use the network.dns block in the job definition to point to the docker bridge IP address

ref: network Block - Job Specification | Nomad | HashiCorp Developer

Alternatively, you can configure the docker daemon to use the docker bridge IP as the DNS for all the containers

# file: /etc/docker/daemon.json
{
  "dns": ["172.17.0.1"]
}

hi @Ranjandas
Thanks for your answer.

Yes, I use GitHub - hashicorp/learn-nomad-cluster-setup: Companion repo for the HashiCorp tutorial collection on Nomad cluster setup repository.

I will try it out and share the result here.

Thanks.

hi @Ranjandas

issue resolved
thanks :slight_smile:

1 Like