Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can you explain me what I need to add in my hosts file for no dns look up

share|improve this question

closed as not a real question by splattne May 24 '11 at 7:54

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Please specify your OS. This question is highly OS-specific. – sleske Mar 24 '10 at 14:00

Can you explain me what I need to add in my hosts file for no dns look up

That is the wrong question to ask. The hosts file does not control whether or not DNS lookups are performed; it just provides a way to obtain IP addresses w/o DNS.

To control lookup behaviour, you need to modify /etc/nsswitch.conf (at least on Linux).

share|improve this answer

The file you need is host.conf, this configures the DNS resolver for the system. To disable external DNS lookups and to use only the hosts file use:

order hosts

In addition, depending on the distribution, you may need to edit nsswitch.conf as well.

share|improve this answer

You probably want to just create an empty /etc/resolv.conf if you want to stop DNS lookups from working.

share|improve this answer

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