1

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 ?

greg0ire
  • 316
  • 1
  • 7
  • 26
  • 1
    That is not going to work, the typical resolver library will only then use an alternate nameserver when the the first one does **not respond at all**. A negative response is still valid response. – HBruijn Aug 05 '15 at 12:28

1 Answers1

3

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.

Sven
  • 98,649
  • 14
  • 180
  • 226