I have a computer with Windows XP SP2 with a weird problem. The hosts file doesn't work. No matter what I do, adding or removing entries in the file doesn't make any difference, pinging the added names times out. I tried flushing the DNS cache (using ipconfig /flushdns) but that didn't work, I even tried to restart the DNS client service but that made no difference too.
Removing entries also has no effect, I ping the names and I get a reply.
Help!!!
Edit:Thanks for your answer guys, but the problem is more complicated than this. It seems I'll have to reinstall Windows.
Mee
MeeMee
13 Answers
I am trying to create a failover cluster without the log shipping in 2012 as i've done it with a static instance with some database.Is the 'AlwaysON' feature the solution when an application creates random and numerous databases within the instance and we need a failover scenario? View 9 Replies View Related. The easiest approach is to delete the host file windows system32 drivers etc that contains the hosts. For this you require administrator privileges. Open a cmd prompt and stop the DNS client using the following command: net stop 'dns client' Navigate to windows system32 drivers etc del hosts Recreate hosts using: echo ' hosts.
Last time that happened to me, I was letting notepad name the file hosts.txt.
It must be named hosts - no extension. Change notepad save as to ..
Kyle HodgsonKyle Hodgson
Suggestions:
1- Make it is named 'hosts.' with no extension. As another commenter noted, sometimes editors will try and impose their default extensions.
2- Make sure you are using the file in the correct location. On my XP box it is C:WINDOWSsystem32driversetc
3- Make sure that the entries you are trying to make are properly formatted. In particular, do not prefix the line with a #; that indicates a comment/remark.
Are you sure about the re-install? I am all for it, I do it once or twice a year to clean the fluff, but what makes you think it will solve the issue with (basically) name resolution?
Good luck
tomjedrztomjedrz
please take this Link as a Reference how to handle and setup your hostfile.
Furthermore, take a look into your Windows Event Log if any error is thrown.
Good Luck,
rAyt
rAyt
Henrik P. HesselHenrik P. Hessel
Delete the 'etc' folder and replace it('etc') from another user, who hots enterties are working fine.
Senaka K
Had the same issue, after a new XP baseline was installed on my computer at work. My previous hosts file was reinstalled in C:WINDOWSsystem32driversetc and I was given write permission to it (so I could modify it if necessary) but I couldn't ping/RDP/ssh to any of the machines by hostname. Tried flushing DNS cache, rebooting, etc, to no avail. Solution was to save hosts to hosts.bak, recreate hosts with default permissions (from parent folder) and paste in the old data. I could then RDP/ping by hostname, and Windoze Admins then able to give me write permission, and it still worked.
Miles WroblewskiMiles Wroblewski
Solved here...
![Attempting Attempting](/uploads/1/2/3/7/123747091/633923543.png)
I had the issue when I had IIS installed. There is a separate host file called:
hosts.ics
Append any changes in this file instead of hosts
RobertRobert
If you entered the default IP for address, 127.0.0.1, you always get a reply for ping, because you are pinging yourself.Instead do a nslookup and see if proper IP is being returned.The idea of hosts is not to block traffic, but to redirect addresses.
Don ZoomikDon Zoomik
The hosts file is for resolving the name to ip address. If your problem is a lack of reply (and the address is correct) then that is another problem.
Have you verified your network is working by pinging the ip addresses instead of the names?
Use the -a option on the ping command 'ping -a ipaddress' to help you figure out the name resolution.
If the name/address resolution is working, use the tracert command 'tracert myhost' to help you figure out where your packets are getting lost.
Donald ByrdDonald Byrd
Make sure you don't have any trailing space after the hostname or it won't resolve either. If you have an entry like '10.10.10.10 yourhost ' and you try to 'ping yourhost' you'll get an unkown host.
BR, Mike
Mike MorsnowskiMike Morsnowski
I had the same problem and I saw in the Event Log an error every time I tried running a ipconfig /flushdns that said 'There was an error while attempting to read the local hosts file.' What fixed the issue for me was to delete and recreate the host file. For some reason that worked just fine.
TheBrainTheBrain
For people like me who, after installing windows, stop/disable every service which wont be used, check if service 'TCP/IP NetBIOS Helper' is running.Without it, the hosts file wont be used at all.
vchrizzvchrizz
If you have any IPv6 entries, make sure that any IPv4 entries precede them!
RickRick
On Windows XP you can stop the service called DNS CLient, if the service is in running state windows ignores your host file.
CobusCobus
Not the answer you're looking for? Browse other questions tagged windowsdomain-name-system or ask your own question.
Similar help and support threads | ||||
Thread | Forum | |||
Windows 7- 'hosts' file is missing-what to do? The 'hosts' file in C:WindowsSystem32driversetc is missing. The only files are lmhosts.sam, networks, protocol and services. I tried searching for the 'hosts' file but couldn't find it in my pc. What should I do here? | System Security | |||
Problem modifying hosts file, change file permissions? Hi all,win7 Home Premium 64 bit. I'm having difficulties modifying my hosts file. Following guidance from this forum, I open Notepad++ as administrator & can navigate to and open the hosts file. But the "Save" option is greyed out, so I can't save directly to the original location. I can Save As... | General Discussion | |||
Hosts file ignored and replaced with hosts.original Hello. I am trying to use the hosts file. However both pings and web addresses still bypass the hosts file. I noticed that there is another file in the C:WindowsSystem32driversetc directory called 'hosts.original'. When ever I delete this file, it reappears seconds later. I have made sure that... | General Discussion | |||
Why is my hosts file missing? Hi there, My hosts file on c:WindowsSystem32driversetc is missing. It doesn't exist anymore. I have tried to put it back in place by using a Microsoft Fix found here How can I reset the Hosts file back to the default? But as soon as the hosts file is back it is deleted again and... | System Security | |||
HOSTS File - Create a 'Edit HOSTS file' Shortcut How to Create a 'Edit HOSTS file' Shortcut in Windows 7 and Vista The HOSTS file is a .txt file used in Vista and Windows 7 to map hostnames to IP addresses. Your computer checks this file first to resolve any network names to its corresponding IP address before it tries to check the Internet.... | Tutorials |