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

I've got a general query regarding the location of the hosts file on Windows. It resides at this location:


My question is why? Could Microsoft have picked a more obscure location for a hosts file?

share|improve this question

Well, I'm not a microsoft insider, but here is my logic:

%WINDIR% - All windows files are here
system32 - these are for 32 bit system binaries
drivers - well ... drivers
etc\hosts - you need to understand that the Windows TCP/IP stack is an implementation of the BSD TCP/IP stack, in *nix systems the host file is at /etc/hosts

This is my best guess as to why it was put there.

share|improve this answer
Agreed, along with the fact that microsoft doesn't seem altogether comfortable with plain text config files, so it stands to reason that they would choose an awkward location for one of the most commonly-used files. :) – EEAA May 28 '10 at 4:22
Another reason it's in an obscure location is that you don't often edit the hosts file in windows. – Ward May 28 '10 at 5:14

If you don't like that location you could always change it by going to regedit and modifying this value: \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath

share|improve this answer
This no longer works in Windows 7. >:-| – Synetech Sep 19 '11 at 19:40

My guess is that it's a system file, so that's why it is at that location.

For what it's worth, you can create a shortcut to the file, the shortcut being in a more convenient location. As an example, when I use Apache on my Windows desktop, I'm wanting to add virtual hosts, which requires modifying the hosts file so they can be accessed. So I have a shortcut to the hosts file located in my Apache config folder.

share|improve this answer

Yes, they could have.

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.