Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: DNS entries in hosts file are being ignored

13 Dec 2013   #1
Zigawaguay

Windows 7 Professional 64bit
 
 
DNS entries in hosts file are being ignored

I have a webserver in my network with the address 192.168.10.110 with several websites running on it. To play around with all the different websites but without having to change the DNS server in our company, I'm using the hosts file:
%SystemRoot%\System32\drivers\etc\hosts

Right now it's like this:
192.168.10.110 example (separated by tab)

Now if I ping "example", the system tells me that the host is not reachable. If I ping the IP address, it works just fine. For the website I need a name though.

THIS HAS ALWAYS WORKED UNTIL A FEW DAYS AGO! Since about 2 days, my system just ignores what's in my hosts file and I'm running out of ideas what this could cause.

I have tried the following:
- Copied the original untouched hosts file from another computer, added a single entry and it didn't work
- Deleted all the entries but one. I have separated it by space and by tab (tab has always worked)
- Tried different codings of the file from Notepad++ (ANSI, UTF-8)

If somebody has an idea, I would appreciate it.

System: Windows 7 Professional, 64bit


My System SpecsSystem Spec
.
13 Dec 2013   #2
UsernameIssues

W7 Pro SP1 64bit
 
 

Welcome to the Seven Forums.

Did you add patches on Patch Tuesday?
If so, maybe back them out one at a time.
My System SpecsSystem Spec
13 Dec 2013   #3
UsernameIssues

W7 Pro SP1 64bit
 
 

Also, is your DNS Client service running?
My System SpecsSystem Spec
.

16 Dec 2013   #4
Zigawaguay

Windows 7 Professional 64bit
 
 

I have checked, there were no relevant updates within the questionable time range that could have affected this issue. Only a few Office updates, but I don't think an Office update should cause such a problem.

My DNS Client service actually is running, BUT I have shut it down and as soon as this service is stopped, it works!!
I couldn't say 100%, but I'm pretty sure that this service was always running and I guess it would be good to have it running, but at least for now I have a solution.
Do you have any idea how I could get it back running with the hosts file still working?
My System SpecsSystem Spec
16 Dec 2013   #5
UsernameIssues

W7 Pro SP1 64bit
 
 

Several websites that provide HOSTS files suggest not running the DNS service. I've not run it for years. I would post links to those websites for you to read, but the forum blocks such links because they discuss ad blocking (discussing that is against forum rules).
My System SpecsSystem Spec
17 Dec 2013   #6
Zigawaguay

Windows 7 Professional 64bit
 
 

I will find information about it. If I don't have to run the service, that's fine too. I still don't know exactly what it's doing, but for the last 2 days now my computer has run just fine without it. So I guess I will just shut it down.
Still wondering what has changed and why I got this problem in the first place, but I'm glad I can access my sites again. Thanks for your help.
My System SpecsSystem Spec
17 Dec 2013   #7
UsernameIssues

W7 Pro SP1 64bit
 
 

The DNS service caches IP addresses. This cache is kept in RAM, so it is cleared each time you restart the computer.

I'm not sure what changed on your network, but turning off the DNS service forces each app to request the resolution of each URL instead of using the service. If you are really bored, scan thru this old post.
My System SpecsSystem Spec
Reply

 DNS entries in hosts file are being ignored




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
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:\Windows\System32\drivers\etc directory called 'hosts.original'. When ever I delete this file, it reappears seconds later. I have made sure that...
General Discussion
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
HOSTS file
I setup a hosts file in windows xp in order to use my website locally using the exact domain name by editing the hosts file by adding the line: 127.0.0.1 www.test.com This should resolve my local ip address for the test.com site and if apache is running, then it should load the website...
Network & Sharing


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 21:45.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App