@SDJL
Thanks for the suggestion. I asked a senior support person at my ISP about the resolv.conf change and he replied:
Nameservers are simply servers running a DNS service (named) that performs lookup requests for servers. Your server runs the same DNS server (named) as most other nameservers and it should be returning the same DNS records. Why do we set it to localhost? Because your server runs named locally and it also is the authoritative nameserver for your domains. That means when changes are made to your domain’s DNS Zones, they are made at the local server and then propagate to other nameservers slowly over time.
Here is an example of a situation where the nameserver is set to something other than localhost which will reveal why “nameserver 127.0.0.1” is most efficient:
- You decide one day to purchase a new dedicated IP and switch forkmedia.com to that IP address.
- The DNS Zone for forkmedia.com is updated on the authoritative nameservers (your dedicated server) so that the domains are set to start resolving to the new IP address.
- Your dedicated server is using a nameserver located elsewhere on the network or even in another part of the world. Because of this, forkmedia.com will continue resolving to the old IP address on the server for 4 hours or more because of DNS caching and propagation times. Only when the server it is using for lookups has its cached entry for forkmedia.com expire and it performs a new lookup request will the IP address change when looked up locally.
- Contrastingly, if 127.0.0.1 were the first resolver in /etc/resolv.conf, a lookup for forkmedia.com would reveal the new IP address immediately.
If you really don’t like seeing 127.0.0.1 in /etc/resolv.conf - The following would be exactly the same:
nameserver [my nameserver IP in format 000.000.000.001]
nameserver 000.000.000.002
That’s because those IPs are both on your server and so they would essentially send the lookup request to the same place that 127.0.0.1 would - Technically however 127.0.0.1 would still be preferred because if (hypothetically) all the IPs on your server were changed the above configuration would stop working, however a configuration using 127.0.0.1 would always work.
In the end, you can use whatever nameservers you want, regardless of where it is located, as long as it is responding to DNS lookup requests. You just have to worry about the stability of that nameserver and deal with a delay on the local server after you make any changes to your DNS zones. If you want to remove 127.0.0.1 from /etc/resolv.conf and test it with other nameservers that shouldn’t do any harm as long as the nameservers you use are responding to lookup requests.
end quote
As a side result of the 127.0.0.1 addition to my resolv file, I also noticed the Google Analytics “Network Locations” pane is now showing 90% of my visits coming from my site, rather than individual IPs.
I haven’t commented out the 127.0.0.1 from the resolv file yet as I asked for some clarifications from my ISP.
I also noticed the difference between GA and Mint has creeped up from 15-20% to 20-25% difference in the past few days…