10

In the list of nameservers in resolv.conf, can I use different nameservers (one from ISP, one from Google, etc..) in each line or does it all have to be from same source?

Example:

nameserver 123.12.12.123   <-- ISP
nameserver 8.8.8.8 <-- Google
nameserver 75.127.14.107 <--- OpenNIC

Is mixing the nameserver sources normal or is it advisable to stick to only 1 source with 2 or 3 ip addresses from them?

I am asking this cuz all docs and examples I've seen only shows ip addresses from 1 source either Google, ISP, or other third-parties. I havent seen 1 that has mixed nameservers and wondering if that's normal.

1 Answer 1

14

The way names in resolv.conf works is that a hostname is attempted to be resolved by the FIRST name in the list, waits until a timeout, then proceeds to the next one and so on until you exhaust the list of nameservers.

If what you are trying to do is to use multiple hostname resolution souces concurrently, this is not the way things are designed.

As to acceptability of including multiple souces, there is no problem.

4
  • just watch for DNS issues if you do not get the same results from every DNS (think f.e. blocked or seized domains etc.) Jan 12, 2015 at 9:27
  • What if a nameserver tells you it can not find your IP? I mean there should be three results when querying a server: 1.it returns the IP 2.it times out 3.it can not find your IP. And the man page only explains 1 and 2.
    – cizixs
    Jul 13, 2017 at 13:13
  • @cizixs I think 3 is covered by 2. It either couldn't find the IP or failed at some point, both of which would cause a timeout.
    – Jordan
    Mar 19, 2018 at 19:03
  • @Jordan Actually 3 is covered by 1. If it cannot find the ip, it throws an error response and not a timeout. So "not found" is also a resolution
    – manikawnth
    Apr 24, 2018 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.