Windows – Reasons System32 Hosts File is Not Working

hostswindowswindows-server-2003

Here's my C:\WINDOWS\system32\drivers\etc\hosts file:

127.0.0.1          localhost
192.168.100.1      router

testing it:

C:\>ping router
Ping request could not find host router. Please check the name and try again.

C:\>ping 192.168.100.1

Pinging 192.168.100.1 with 32 bytes of data:

Reply from 192.168.100.1: bytes=32 time<1ms TTL=64
Reply from 192.168.100.1: bytes=32 time<1ms TTL=64
Reply from 192.168.100.1: bytes=32 time<1ms TTL=64
Reply from 192.168.100.1: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.100.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

It used to work. I used to have numerous redirects in there. But it stopped working a few weeks ago.

I've checked all the obvious:

  • deleted the hosts file and replaced with this simple one just for testing
  • no invalid characters in the hosts file
  • no file extension on the hosts file
  • not using TAB to separate IP and hostname (tried using exactly 8 spaces)
  • ipconfig /flushdns
  • restart the DNS Client service
  • permissions on the file matches the permissions of the DNS Client (I've also tried "allow" for "everyone" on both the hosts file, and the "etc" folder, and also the "drivers" folder).
  • tried adding the NETWORK SERVICE user, and the LOCAL SERVICE user to this file permissions
  • no anitivirus/spamware/malware/resident shields running on this particular machine
  • tried the hosts file both with UNIX and DOS EOL markers
  • reboot the machine

What am I missing?

Best Answer

From what you have done, and the list of things you have checked makes me think some sort of system failure as it looks like you have done the correct things, try doing "SFC /SCANNOW" from the command line just to test for system problems.

Related Question