Computing.Net > Forums > Windows XP > Hosts File Problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Hosts File Problem

Reply to Message Icon

Name: sirclive
Date: January 26, 2006 at 00:54:36 Pacific
OS: Windows XP SP1
CPU/Ram: Pentium M 1400 / 512MB RA
Comment:

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 mygoogle

Then 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



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: January 26, 2006 at 02:58:15 Pacific
Reply:

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


0

Response Number 2
Name: IamBiGePaNtS
Date: January 26, 2006 at 03:10:18 Pacific
Reply:

Do a google search for a little nasty called QHOST

Click Here For QHOST search


0

Response Number 3
Name: Mechanix2Go
Date: January 26, 2006 at 03:22:30 Pacific
Reply:

The one I really like is:

Earn $1,800/Day

FAR OUT


If at first you don't succeed, you're about average.

M2


0

Response Number 4
Name: sirclive
Date: January 26, 2006 at 06:51:18 Pacific
Reply:

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!


0

Response Number 5
Name: Mechanix2Go
Date: January 26, 2006 at 07:21:30 Pacific
Reply:

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


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon

Can't install 2nd Windows... Missing memory stick



Post Locked

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


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Hosts File Problem

Problem with hosts file www.computing.net/answers/windows-xp/problem-with-hosts-file/66233.html

Hosts file www.computing.net/answers/windows-xp/hosts-file/157991.html

Host File www.computing.net/answers/windows-xp/host-file/80415.html