0

I was told today that /etc/hosts is not a viable option for testing a new destination server. The DNS for /etc/hosts modifications could still cache the old DNS settings and we would get incorrect results on testing.

The only option we were given is to setup a proxy server and set the proxy info in each browser.

I am wondering if this is the case do I need to setup every browner on my machine to test?

4

/etc/hosts does not use DNS at all so talking about DNS cache makes no sense. This file is authoritative over DNS concerning name resolution, as specified in /etc/nsswitch.conf (the Name Service Switch config file).

So if you enter a IP-host mapping in /etc/hosts it will always take precedence over DNS. (Of course, unless you modified /etc/nsswitch.conf, and you should have a good reason to do so.)

  • The only remark I have is: sometime is required to restart naming cache daemon – Romeo Ninov May 7 '15 at 13:01
  • 1
    And to be precise, normally the hosts entry in nsswitch.conf is configured to files dns. If you exchange those two, DNS will take precedence over the /etc/hosts file. – Lambert May 7 '15 at 13:15

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.