DNS randomly stops working on windows 7

Red Squirrel

No Lifer
May 24, 2003
69,690
13,325
126
www.betteroff.ca
I noticed a problem that recently surfaced, every now and then DNS stops working on my windows 7 machine. I have to reboot it a couple times before it finally works. Basically it just fails to resolve any host names. Super annoying as if I'm gaming and want to switch characters it usually can't resolve the game server anymore so I have to reboot a bunch of times before it finally works. Is there a way to make it work permanently? On all my other systems it works fine. Does Windows need a Wins server? I never bothered setting it up when I migrated my DNS to a new VM and it seems to have happened since then.
 

SparkyJJO

Lifer
May 16, 2002
13,357
7
81
Check to make sure it isn't a router DNS or ISP DNS issue first. I ran into an issue with DNS once and come to find out one of TWC DNS servers was screwed up.
 

Red Squirrel

No Lifer
May 24, 2003
69,690
13,325
126
www.betteroff.ca
If you know games server's name & ip address, you can modify Windows 7's hosts file and be done with it. System will query hosts file before DNS server.

http://helpdeskgeek.com/windows-7/windows-7-hosts-file/

But it could be the route between your PC and game server causing problem.

I'm not going to start putting a host entry for every single host I need to access, that's the point of having a DNS server.

I was doing more troubleshooting and it seems for whatever reason Windows keeps thinking the old DNS server is still active when it's not, and keeps reverting to wanting to use that one. I forced it to the new IP in the tcp/ip settings, I'll see what happens. Not sure why I should have to do that though as the new IP is being pushed through DHCP.
 

mxnerd

Diamond Member
Jul 6, 2007
6,799
1,103
126
Have you checked your DNS server? Do you setup DNS forwarders correctly? Is the DNS cache stagnant? Probably needs to clear DNS cache?

dnscache2003.gif


And DNS Client query sequence explained by Microsoft
https://technet.microsoft.com/en-us/library/cc772774(WS.10).aspx

The following figure shows how the DNS client queries each server on each adapter.

IC195480.gif
 

Red Squirrel

No Lifer
May 24, 2003
69,690
13,325
126
www.betteroff.ca
Using named/bind for DNS and not Windows DNS. It works fine on all the other machines. It's just the Windows machine that seems to like trying to revert back to the old DNS server. Basically I'm upgrading my main server OS as it is Fedora Core 9 (super old) so I've been migrating services one at a time to a new server I setup as a VM. It was easier to migrate one service at a time and DNS was one of those services which meant I had to change the IP around my network. I could leave it running on the old server but by turning it off it is an easy way to indicate if I forgot to change it anywhere on my network and don't want surprises when I physically turn down that server.

Forcing the DNS to the new IP in the tcp settings seems to have fixed the issue though. Something in the OS kept making it go to the old server it seems. Though it's kinda a bandage as I was relying on DHCP to get the DNS IP.
 

SparkyJJO

Lifer
May 16, 2002
13,357
7
81
I've changed DNS in DHCP many times on Windows networks and never had that issue, except for when there was the old DNS server still set somewhere in the DHCP server, or there was a rogue DHCP server floating around that would butt in and screw things up.
 

Red Squirrel

No Lifer
May 24, 2003
69,690
13,325
126
www.betteroff.ca
Yeah I've done it before too without issues, it's really strange. I just removed the setting I did to see if it starts getting the old IP again. Maybe that forced some kind of local cache to clear.