

Ask HN: Why is the Windows hosts file in such an odd location? - junto

On modern Windows:<p><pre><code>  %SystemRoot%\system32\drivers\etc\hosts
</code></pre>
It used to make more sense (to me at least):<p><pre><code>  %WinDir%\HOSTS
</code></pre>
Is it some kind of homage to UNIX or a standardization attempt?<p>Does anyone know why Microsoft choose that folder?
======
bjourne
[http://www.kuro5hin.org/?op=displaystory;sid=2001/6/19/05641...](http://www.kuro5hin.org/?op=displaystory;sid=2001/6/19/05641/7357)

Windows used to, and perhaps even still does, incorporate some bsd-licensed
code in its network stack. That's a plausible explanation for the unixy path
to the hosts file.

------
bhartzer
Where do you think it should be? Back at %WinDir%\HOSTS or somewhere else?
Does it really matter where it is, anyway?

~~~
junto
I just was interested to know if anyone here knew the history of the decision.

Is it a "driver"? Why "etc"?

I was just adding a temporary entry to it, and was genuinely curious as to why
such decisions are made.

And yes, for me that old location is less clicks in Explorer to navigate to.
For most users the location irrelevant, but since I often add and remove
entries it made my start thinking about it. :-)

------
buckyball
I really wanted to ask this many times.

> Is it some kind of homage to UNIX

this!

~~~
junto
I'd quite like this to be the case! I'm imagining some contract MS engineer
with a deep love of UNIX snuck in a change to the core of Windows without
anyone noticing.

I doubt it though!

~~~
dan_b
The Windows network stack is built on BSD code.

------
zura
That. And also mysterious "Xerox" directory, up to and including XP :)

~~~
stevekemp
That at least has been answered, on Raymond Chen's excellent blog:

[http://blogs.msdn.com/b/oldnewthing/archive/2004/11/16/25822...](http://blogs.msdn.com/b/oldnewthing/archive/2004/11/16/258220.aspx)

