/ digital life

host file on win gets ignored

I have reinstalled my system and I was very irritated that my host file is ignored by xp. But luckily windows resolves names in a few more steps than linux. If you have the same problem, here is a solution ;)

Basicly windows resolves names in the following order:

  1. cache
  2. host file located in %SystemRoot%\system32\drivers\etc
  3. DNS server lookup (tcp/ip settings)
  4. WINS server lookup (tcp/ip settings)
  5. lmhosts also located in %SystemRoot%\system32\drivers\etc
I haven't tryed to modify DNS/WINS server (you can only enter an IP Address) but therefore the lmhosts and it works very fine for me. Inside lmhosts are some examples and it's basicly the same syntax as for the hostfile.

Additions:

In my case ip6 caused this behaviour, because of its notation. Switching back to ip4 will solve it ;)

host file on win gets ignored
Share this