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

Please provide examples of how this can be setup on client and server versions of various operating systems.

share|improve this question
I guess you need to add more information on what you are looking for, since setting up hosts file for any OS (windows or Linux) is pretty much the same, except or the path – Dinesh Manne May 3 '09 at 18:56
This was something I was looking into at the time and figured it was good content to have on – Brian Lyttle May 3 '09 at 19:58
up vote 12 down vote accepted

Hosts file on Linux/Unix:

/etc/hosts   name1 name2

Hosts file on Windows:

%WINDOWS%\System32\Drivers\etc\hosts (e.g. C:\Windows\System32\Drivers\etc\hosts)   name1 name2
share|improve this answer

Assuming you're asking how to find the file (it will most likely exist already):

  • In a Unix-like operating system (including Mac OS X and Linux), you'll typically find the hosts file in /etc/hosts. Note that Mac OS X does not by default show you the etc directory. You can show it in various ways, such as by choosing Go → Go to Folder… in Finder, and typing /etc.
  • In an NT-based operating system (including Windows XP and Windows Vista), the etc directory is slightly hidden, in %WINDIR%\system32\drivers\, e.g. C:\WINDOWS\system32\drivers\etc\hosts.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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