Can nomad dns resolve to a local hosts' host file?

Can nomad dns resolve to a local hosts’ host file? Or do I have to run a local dns server for internal ips?

Brad

See linux - How do `/etc/hosts` and DNS work together to resolve hostnames to IP addresses? - Unix & Linux Stack Exchange

However, I run dnsmasq on every nomad node to allow to also resolve consul domains:

$ cat /etc/dnsmasq.d/00-default
server=8.8.8.8
server=/consul/127.0.0.1#8600

Thank you this was a very good suggestion… I didn’t understand it at first but now i got it.

Brad

I should have said, you would also need to tell your hosts to resolve to 127.0.0.1 in /etc/resolv.conf. Depending on your distribution / cloud environment, this can be solved in various ways.

Hi @bradley, it seems like your question has been answered with the help of @resmo. If this isn’t the case, or if you have any followup, please let me know.

Thanks,
jrasell and the Nomad team.

A somewhat related discussion; relevant for raw_exec only, I think.