I'm trying to use several nameserver, each one is able to resolve some hosts the other does not.
Here is my resolv.conf :
options timeout:1
# This one is used to resolve hostnames for servers internal to my company
nameserver 127.0.1.1
And this one is used to resolve hostnames for docker hosts I have on my machine
nameserver 172.17.42.1
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
search lmc.universcine.com
When using this order, I cannot resolve the docker hosts. When I put the docker nameserver declaration first, I can. How can I resolve both groups of hostnames ?
This is not how this works. If you get a negative reply from a DNS server, the system will not ask a second server but just assumes the name doesn't exist.
You will have to configure your local nameserver to resolve your local names and then recurse/forward for all non-local domains and only use this local nameserver in your
resolv.conf
.