Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

f:\windows\system32\drivers\etc\hosts

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

share|improve this question
add comment

4 Answers

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
2  
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
add comment

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
add comment

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
add comment

Yes, they could have.

share|improve this answer
add comment

Your Answer

 
discard

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.