Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I used to have a working HOSTS file, such that when I typed in the hostname in a browser window, it would resolve to the IP address indicated in the hosts file.
However, in the last couple of days, this stopped working, and have not been able to get this working again.
Entries in my HOSTS file:
127.0.0.1 localhost
216.239.57.104 mygoogleThen I type in "ping mygoogle" at the command line:
"Ping request could not find host mygoogle. Please check the name and try again."
Seems like Windows is by-passing my hosts file, or not reading it. I have verified the location and made sure it doesn't have any extensions and it definitely exists in
c:\windows\system32\drivers\etc
Thoughts/ideas? Is there a registry value, which may have been trashed, that I need to re-set?
Both Mozilla and IE can't seem to read the entries in the HOSTS file.
Regards,
Clive

Hi Clive,
That's a strange one.
Seems like if windows was ignoring HOSTS and using the DNS, you get "unknown host" as with any non-exisyent domain.
You sound like you're smart enough to have checked the IP number. I put it in my HOSTS just now and it worked.
Are you using DHCP? I don't know if that would affect it; I'm grabbing at straws here.
Stay tuned. There are many network sharpies here.
Bryan! Help!
If at first you don't succeed, you're about average.M2

The one I really like is:
Earn $1,800/Day
FAR OUT
If at first you don't succeed, you're about average.M2

Hmm, I definitely haven't got the "W32/Qhost.A" exploit.
I downloaded the MVPS HOSTs file from www.mvps.org and ran the mvps.bat file. This replaced my current HOSTS file with the one from MVPS.
I then verified that the DNS cache was updated by typing: "ipconfig /displaydns" at the command line - and it indeed found the entries in the HOSTS file.
I then copied the entries from my original HOSTS file into the new one, and once again typed "ipconfig /displaydns" and it once again was correct.
Looks like the bat file worked its magic, as the HOSTS file is now being used. I am still unsure as to what was wrong, but everything seems to be working now.
Contents of the .bat file:
===========================================
:: This batch file is intended to be used only to copy the
:: included (MVPS) HOSTS file to the proper location.
::
:: Any other use is strickly forbidden.
:: http://www.mvps.org/winhelp2002/hosts.htm
::
@ECHO OFF
IF NOT EXIST HOSTS GOTO noHostsFile
IF "%OS%"=="Windows_NT" GOTO HostsFile
IF EXIST %winbootdir%\HOSTS*.* ATTRIB +A -H -R -S %winbootdir%\HOSTS*.*>NUL
IF EXIST %winbootdir%\HOSTS.MVP DEL %winbootdir%\HOSTS.MVP>NUL
IF EXIST %winbootdir%\HOSTS REN %winbootdir%\HOSTS HOSTS.MVP>NUL
IF EXIST %winbootdir%\NUL COPY /Y HOSTS %winbootdir%>NUL
GOTO noHostsFile
:HostsFile
IF EXIST %windir%\SYSTEM32\DRIVERS\ETC\HOSTS*.* ATTRIB +A -H -R -S %windir%\SYSTEM32\DRIVERS\ETC\HOSTS*.*>NUL
IF EXIST %windir%\SYSTEM32\DRIVERS\ETC\HOSTS.MVP DEL %windir%\SYSTEM32\DRIVERS\ETC\HOSTS.MVP>NUL
IF EXIST %windir%\SYSTEM32\DRIVERS\ETC\HOSTS REN %windir%\SYSTEM32\DRIVERS\ETC\HOSTS HOSTS.MVP>NUL
IF EXIST %windir%\SYSTEM32\DRIVERS\ETC\NUL COPY /Y HOSTS %windir%\SYSTEM32\DRIVERS\ETC>NUL
:noHostsFile
CLS
EXIT
===========================================Any ideas what it could have done? It would be nice to know what went wrong the first time!

Yeah, very good to know.
Can you send me both files?
Or post them here.
If at first you don't succeed, you're about average.M2

![]() |
Can't install 2nd Windows...
|
Missing memory stick
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |