DNS Problems

lodger

Ars Scholae Palatinae
610
I'm running Windows 11 on a 2023 Dell laptop. I recently started having trouble with connection timeouts, so I looked up troubleshooting tips, which brings me to the issue.

When I try to stop or reset the DNS client through the cmd line I get: "The requested pause, continue, or stop is not valid for this service."
When I try to do the same through the "services" app, it won't even show the stop or reset options, and if I try properties, stop and reset are greyed out.

Trying to google the solution just gets me lots of pages that say I can solve connection timeouts by resetting the DNS client. Which is the problem in the first place.

SO, how big a problem is this, and how can I actually reset or disable the DNS cache/client?
 

Paladin

Ars Legatus Legionis
33,855
Subscriptor
You can mess with this stuff: https://www.thewindowsclub.com/enable-the-dns-client-service-if-greyed-out

But honestly, I've been using PCs for over 35 years, mostly with Windows through that time period, and have never had to mess with the DNS client service. Flush the cache? Sure. But not the actual service. I've messed with the DNS server service on domain controllers, etc. but never the client service. Restarting the DNS client service is not normal and appears to be disabled on most modern Windows client OS installs.

To get to the point of playing with the DNS client service, you need to eliminate a lot of other possible suspect issues first. Number 1 would be your internet service and router. Most home routers assign themselves as a caching DNS server to DHCP clients on the LAN/Wifi network. Set your PC to use other DNS servers like 9.9.9.9 and 1.1.1.1 or DNS servers provided by your ISP. See if that makes a difference. If it does, the problem is your router's DNS caching server feature. You need at least a firmware update, maybe a new router.

If that doesn't help, it might be your ISP service blocking or dropping traffic to DNS servers other than their own or they are assigning their own to your router to use, and their servers suck. Again you can use other ones and probably get better results. Start with the basics before you try breaking the highly reliable components in your operating system.

But yeah, a malwarebytes scan or whatever is free, quick, and might find something.
 

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
Are you using a VPN client? I often had DNS issues when I used the ProtonVPN official client, where DNS would just stop responding, and I'd have to disconnect the client and often would have to wait a while to use it again because immediately reconnecting even to another node the DNS still wouldn't work. I never tried just restarting the DNS client service or clearing cache, and I never have this problem when using the open WireGuard client with my own DNS servers and split tunneling instead of the ProtonVPN client. The ProtonVPN client also wouldn't properly use DNS servers I specified (even with split tunneling, it always forces to its DNS server for leak protection), and using their server caused ESET NOD32 to be unable to connect to its GRID servers so I got errors from that.

I'm on Windows 10, and my DNS Client service also can't be stopped/started/paused through normal service controls. Nothing I found gives a reliable way to control it like a normal service. It runs under svchost.exe which means you can't just kill a process by name and getting the PID is extra steps. Luckily it does still run as its own process rather than as a bundle with other stuff. You can use taskkill or PowerShell commands to kill it but it instantly starts again. (Of course that might do what's needed.)

taskkill /fi "Services eq dnscache" /f

$ServicePID = (get-wmiobject win32_service | where { $_.name -eq 'Dnscache'}).processID Stop-Process $ServicePID -Force

You can also just use Task Manager to kill the process, on the Details tab, by showing the Command Line column and sorting, and finding "C:\windows\system32\svchost.exe -k NetworkService -p DnsCache".

The person that gave the PS command mentioned that the service is running as an isolated process so it's "protected". I suppose this could be as a malware prevention thing, so nothing can hijack your DNS. But there's basically nothing that I found in a search to really explain it.

Ugh. Formatting in comments should not convert to emojis unless I actually click and select one while typing.
 
Last edited:
  • Like
Reactions: lodger

Gantry

Ars Scholae Palatinae
805
But honestly, I've been using PCs for over 35 years, mostly with Windows through that time period, and have never had to mess with the DNS client service. Flush the cache? Sure. But not the actual service. I've messed with the DNS server service on domain controllers, etc. but never the client service. Restarting the DNS client service is not normal and appears to be disabled on most modern Windows client OS installs.
Co-sign, I've been doing this a long time professionally and never had to do anything with the DNS client service.
 
  • Like
Reactions: continuum

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
Co-sign, I've been doing this a long time professionally and never had to do anything with the DNS client service.
Well, I've been doing it for about 30 years, and I have, so... Not often, but not every experience is the same, although it's probably not going to actually have any effect in this case.
 

Paladin

Ars Legatus Legionis
33,855
Subscriptor
Well, I've been doing it for about 30 years, and I have, so... Not often, but not every experience is the same, although it's probably not going to actually have any effect in this case.
Yeah I am not ruling out the possibility that I have actually run into it (30+ years of experience tells me that nearly anything is possible), but I would guess that if I did, it was something I inadvertently solved with a simple reboot rather than get into the weeds with a client machine that was just a bit fussy. But I am sure that I never had to do it for a recurring issue that persisted beyond a reboot. I imagine if I ever came that kind of thing, I would just re-image the PC or do a fresh install if it is a home/personal machine.
 

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
I would just re-image the PC or do a fresh install if it is a home/personal machine.
That's an awful lot of work versus trying to resolve the root of the problem, if you've got any technical skill to troubleshoot it even with a little assistance from people here, depending on the exact issue. If it was something like my issue, where DNS stopped responding at apparently random intervals when the VPN was connected, spending time troubleshooting it would be a much better option than spending hours wiping and rebuilding my PC and then reinstalling the application causing the problem, since it clearly was not an issue with the OS so rebuilding wouldn't fix it. I spent a few minutes figuring out client options and getting WireGuard installed, and learning how to configure it for split-tunneling, and have had no further issues. (Don't get all the nice features of the Proton client, of course, but their tech support was not helpful at all. They recommended that I remove NOD32 to troubleshoot why their client attempts to modify NOD32 system processes which gets blocked and breaks the VPN client.)

I don't know if OP is using a VPN client yet, but they are just performing troubleshooting steps at this point, including restarting the client, so I don't think they're at the point of trying to use this as a long-term solution to the DNS problems. There's still the possibility that this IS an issue with a third-party application in which case reinstalling the OS wouldn't help once that app was installed again.
 

Paladin

Ars Legatus Legionis
33,855
Subscriptor
Yeah I am talking like a run of the mill work PC where it is 99% stock image and a user account. 10-15 minute reinstall and login and it is pretty much done. Heck, it doesn't even have to be reimaged immediately, I can just have someone swap it out and work on it later.

If it's a home PC that suddenly develops a weird flakey issue with intermittent DNS issues, but nothing on the other devices on the network has a problem, then I know it is probably a software issue on the machine so I would start with a reboot after a quick check of the network config. If the reboot doesn't solve it then yeah, maybe more troubleshooting or looking for weird demo software that might be installed (firewall stuff) or malware scan. But I have never really had that kind of issue on my home machines. If it is someone else's home machine I will let them do their own support unless they are family. In which case I go back to very quick diagnosis and troubleshooting and then backup the data and reinstall if none of the quick answers solve it. I don't have time to spend hours on digging into a PC with issues if I am not getting paid for it. :D
 

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
Yeah I am talking like a run of the mill work PC
Well, you said you'd reinstall the OS if it was a home/personal machine, not business. :) (I didn't read "re-image" as referencing work machines separately from the fresh install.) With business PCs, anything causing an issue like that would almost HAVE to affect nearly every machine at once, as they ought to be nearly identical in most businesses, or at least usually have a few people with the same setup, and either be related to an OS update or a specific application update or recent new install. With limited possibilities, it ought to be easy to eliminate possible app causes (and remove anything the user was able to install themselves) to narrow it down to the OS and then try a reinstall for one user, but that would totally suck to have to do it for many, especially those with the 4 hour install process. (Unfortunately in my last job, working with small businesses, maintaining stock images for fast turnaround wasn't a practical option, because of the amount of time that passed between needing them. And most wouldn't pay for even a spare machine that had the majority of their apps already installed so it could just be a matter of updating.)
 

AmitY

Wise, Aged Ars Veteran
177
You may need administrator privileges. To get them, try to open 'powershell' or 'Windows Terminal as administrator, and run from there:
Code:
ipconfig /flushdns

Another way is to access the router's page (for example "192.168.1.1", if your router is TP Link) , and restart the router. You'll need the admin's pass to access your switch/router
using the browser, but it works on all systems.
 

lodger

Ars Scholae Palatinae
610
To get to the point of playing with the DNS client service, you need to eliminate a lot of other possible suspect issues first. Number 1 would be your internet service and router. Most home routers assign themselves as a caching DNS server to DHCP clients on the LAN/Wifi network. Set your PC to use other DNS servers like 9.9.9.9 and 1.1.1.1 or DNS servers provided by your ISP. See if that makes a difference. If it does, the problem is your router's DNS caching server feature. You need at least a firmware update, maybe a new router.

I've tried the following:
  1. Using different browsers (Chrome, Firefox, Edge)
  2. Using different networks (the problem persists both at home and at work)
  3. Resetting TCP/IP
  4. Using the Google Public DNS server (8.8.8.8.; 8.8.4.4)
  5. All of the Chrome-based fixes listed here: https://thegeekpage.com/10-ways-to-fix-this-site-cant-be-reached-chrome-error/

Fiddling with the DNS client seems to be the only unexplored avenue for a fix.
 

ColinABQ

Ars Tribunus Angusticlavius
6,378
Subscriptor++
Another way is to access the router's page (for example "192.168.1.1", if your router is TP Link) , and restart the router. You'll need the admin's pass to access your switch/router
using the browser, but it works on all systems.
For that matter, a relatively quick and simple router and/or switch power cycle might be a good idea. And some IoT device exploits/compromises can be cleared that way (not that that's an issue, just thinking out loud). Based on what's known so far, that would be my next move and I can't image it causing any harm, other than a brief network outage for all connected clients.
 

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
I've tried the following:
  1. Using different browsers (Chrome, Firefox, Edge)
  2. Using different networks (the problem persists both at home and at work)
  3. Resetting TCP/IP
  4. Using the Google Public DNS server (8.8.8.8.; 8.8.4.4)
  5. All of the Chrome-based fixes listed here: https://thegeekpage.com/10-ways-to-fix-this-site-cant-be-reached-chrome-error/

Fiddling with the DNS client seems to be the only unexplored avenue for a fix.
Are you using VPN?
When the problem starts, can you go to command line and ping the DNS server, or perform nslookup commands? What DNS server does it report is used?
Can you ping the gateway IP? Other resources on the local network, by IP or name?
Is the browser being unable to reach sites the only problem you see? (Example: can you still access shared folders on the work network, if there are any? Does your email client still work if you use one? Do you have any streaming media going?)
Does the problem go away if you restart the laptop? Does the problem ever resolve itself?
Is it a company laptop?
Restarting the DNS client is unlikely to resolve this issue if all those other things didn't, but if restarting the laptop does then maybe restarting the client would. You could make a batch file with the command to do it quickly, but that doesn't fix the underlying issue.

It looks obvious that it's not a router issue if it happens in two different places. And those fixes on thegeekpage are just generic troubleshooting, outdated in some cases (flat out wrong on #4 since that's not DNS prefetching and isn't on the settings page they referred to), and unlikely to do anything for an intermittent problem unless your actual DNS servers were intermittently unreachable, and changing your DNS servers can cause other problems especially on a company network that depends on name resolution from the local server.
 
  • Like
Reactions: lodger
But honestly, I've been using PCs for over 35 years, mostly with Windows through that time period, and have never had to mess with the DNS client service.
I used to get all kinds of weird results with the DNS client. I routinely disabled it on all computers on my networks, because it was so troublesome, not correctly reflecting what my Linux DNS servers were saying. Local machines totally didn't need the service, you could just turn it off and nothing changed, except that you'd always get the correct, current result from the server.

I have the vague idea that they took that ability away in Win10, that you now have to run the DNS client service, which is really stupid. There's no good reason to cache DNS locally, a modern DNS server can handle an ungodly number of clients. That's a Pentium-era design decision, just worthless with octa-core 4GHz processors available on the super-cheap.

But, like it or not, I think it can't be disabled or stopped anymore. I'd have to go look to be sure, however, and I feel lazy right now.
 

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
I used to get all kinds of weird results with the DNS client. I routinely disabled it on all computers on my networks, because it was so troublesome, not correctly reflecting what my Linux DNS servers were saying. Local machines totally didn't need the service, you could just turn it off and nothing changed, except that you'd always get the correct, current result from the server.

Until this thread, and this comment, I didn't even know the actual service name was "dnscache" or that it just works for caching. I assumed it was the actual process that retrieved DNS records from the configured servers when requested by an application (after first checking the cache and HOSTS file). So what IS the process in the OS that applications request IPs from, and which actually connects to the name servers?

It's not just a matter of processing power for the name server, but that is still an issue. Sure, it's not using up YOUR CPU time, but the people running the servers don't want all those direct connections for every single lookup, be it the root servers or your ISP or Google. Most people don't have their own PCs running as a DNS server on their local network to do the caching for them, and not all routers act as caches. And the only way to say that you would ALWAYS get the correct current result is by having zero caching whatsoever, and performing all lookups to the root servers with your local server just being a relay (aside from local resources of course). Even your ISP or Google are just a level of cache for lookups of anything outside their own networks. For the vast majority of users, the local cache service works fine and provides some benefit even if it's minor because they have a local DNS server that caches, with 99.999999% zero problems.

One person's lookup is nothing, but 4 billion people doing 1 lookup each every second (average; burst might be 10 per second as a page loads all the shit on multiple domains) is a lot, and in aggregate even if it means having to add 1% hardware to their servers, that is expensive hardware and no corporation wants to spend just to make it more convenient for you. On top of that, there is the bandwidth, which again, isn't much for one person, but is a lot in aggregate. Then there's the latency. A lookup from your local cache takes nanoseconds; it's effectively instantaneous as far as your browser is concerned. A lookup from your router's cache or local network DNS server takes 1 ms, orders of magnitude longer (and again, maybe dozens of them for one page to load, though much can be done concurrently). If you are doing lookups directly from your ISP or Google, you're talking about 5ms to 15ms depending on service, with the ISP often being the higher latency because they route the request across the country to their one set of servers instead of having local ones.

If you really want to disable it, you might be able to modify the service configuration in the registry. Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dnscache > Start. Set it to 4 and reboot. This has been claimed to work, though it might be something Windows will repeatedly undo.
 

Paladin

Ars Legatus Legionis
33,855
Subscriptor
I've tried the following:
  1. Using different browsers (Chrome, Firefox, Edge)
  2. Using different networks (the problem persists both at home and at work)
  3. Resetting TCP/IP
  4. Using the Google Public DNS server (8.8.8.8.; 8.8.4.4)
  5. All of the Chrome-based fixes listed here: https://thegeekpage.com/10-ways-to-fix-this-site-cant-be-reached-chrome-error/

Fiddling with the DNS client seems to be the only unexplored avenue for a fix.
Yeah, if you have done all that, and eliminated other variables like privacy/VPN service, in browser secure DNS settings, and malware, that's the point where I would be thinking about a fresh install.
I would at least try a Linux live boot to test for a while to see if it still happens or one of these windows usb boot troubleshooting tools: https://www.slant.co/topics/859/~best-system-rescue-discs-for-windows

If the problem happens under a different OS or live boot, it might be a hardware networking issue that just happens to affect DNS queries more visibly. If it goes away under a different OS, backup all your stuff and do a fresh install. For me, I usually take that as a sign to buy a new SSD (problems that make me want to reinstall a personal PC seem to crop up around the 5-7 year mark when I am about ready for a new drive anyway) and just do a fresh install to that and use my old drive as a kind of archive to get data from and restore to the new one. That way my other backups remain untouched during the process so I don't move or delete something in the backups by mistake.
 

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
buy a new SSD
He's on a 2023 Dell laptop, so that might be a bit much. :) Although getting a super-cheap SSD, like $15, to install and test with isn't a terrible idea. (I still consider having a backup image on a USB drive just as good as pulling out the drive and using a completely new one from a restorability standpoint, and then continuing to use it for backups afterward.) Not sure just how often the issue crops up, to indicate whether it's viable to work with something booted from a USB stick long enough to be a good test without a reasonable suite of applications installed. I had a lot of issues installing things on some of the WinPE tools like Gandalf's, though I never heard of Bob.Omb's before. WinPE isn't a fully functional Windows, and Linux may not support what's needed.
 
Sure, it's not using up YOUR CPU time, but the people running the servers don't want all those direct connections for every single lookup, be it the root servers or your ISP or Google.
Almost everyone, at least in the developed world, is running a caching resolver on their network, usually on their router or router/AP. And pretty much all commercial networks have at least two servers, often many many more.

A per-machine DNS cache is really not needed.
 
Last edited:

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
Almost everyone, at least in the developed world, is running a caching resolver on their network, usually on their router or router/AP. And pretty much all commercial networks have at least two servers, often many many more.

A per-machine DNS cache is really not needed.
Well apparently every OS engineer other than for Linux disagrees. (And I guess also Ubuntu engineers?)
 

Paladin

Ars Legatus Legionis
33,855
Subscriptor
Systemd includes systemd-resolved in most distros as well but it is not turned on at boot on most so technically linux has it but doesn't 'do' it unless you turn it on. ;)

I really don't see much issue with it, it's beneficial in most cases and rarely causes issues and is trivial to clear for troubleshooting. In the case in question here, I think it is still very unclear whether the local DNS cache service is at fault at all. The main complaint is web page timeouts, not DNS resolution errors (address/domain not found, etc.) so it is, in my opinion, likely a network hardware issue or software issue related to the network connection. There was no final word on whether VPN or privacy proxy service is in use, or if this is on a wired connection or wifi or both.

You can watch the console on the browser via the F12 key (look for the network section) and do some page loading where you see the issue happen. You should be able to see if you are getting a timeout, rejection, DNS lookup failure, etc. Then try the different network interfaces (wifi or wired) if possible, and even a USB live boot of Linux or WinPE like Bob.om's to see if the problem persists on a different OS. As long as the hardware is not super special it should work well enough for testing with those tools.

The worry about being able to restart the DNS resolver client service is pointless. You can simply reboot the computer to see if that helps with the problem. No need to dive down a rabbit hole of powershell scripts, permissions, registry changes, etc. Just reboot and see if it fixes the issue for any reasonable amount of time. I'm guessing you already did that and it didn't make any difference so restarting the service manually won't do anything useful.
 

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
You can simply reboot the computer
That's not always the most practical solution, if you're in the middle of work that won't be automatically saved and restored by Windows and have to spend time saving and closing things, or CAN'T save your current state like being in the middle of something online (which may still be open but unable to continue, but not yet lost). A batch file that just restarts a service or clears a cache would be far more practical, if that resolves the issue. But, a restart would certainly clear EVERYTHING that might be causing a problem. OP did say they "reset TCP/IP" but I don't know if that means using the "Network reset" in Settings or just setting the network configuration to automatic, and whether rebooting was tried hasn't been mentioned. Since rebooting does clear EVERYTHING, it doesn't help to narrow down the one thing that is causing the problem and allow you to resolve that one thing so that the problem is actually eliminated, so restarting a service like this is still a valid troubleshooting step. Rebooting is just a quick fix but not a long-term solution, unless it's just an unfixable bug and troubleshooting never finds the cause.
 
I think it is still very unclear whether the local DNS cache service is at fault at all.
It may not be. I was just saying that it used to be wonky, not that it is now. I haven't had problems with it in a very long time. I don't need it, I think it's a silly service, but it's not causing any problems that I know about.
 

Andrewcw

Ars Legatus Legionis
19,138
Subscriptor
So is this problem easily to replicate. As you can do it ever few minutes rather then at random times? I mean i've had bad hardware do this. Curse you Microsoft Surface Tablets.

Does the problem exist long enough like minutes where you could load up a VM within the machine and see if it really is the DNS stack of the host OS?
 

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
Does the problem exist long enough like minutes where you could load up a VM within the machine and see if it really is the DNS stack of the host OS?
Oooooh, good suggestion! I didn't think of hardware possibly being the problem because it seems like it would be obvious if link was being lost (especially Wi-Fi), but I guess it can't be ruled out depending on the timing of it.
 

Lord Evermore

Ars Tribunus Militum
2,570
Subscriptor++
There is no way that the DNS Client service had anything to do with the issue if it was permanently resolved by restarting it once, unless you really did never reboot the computer. (And I still would doubt that it was at fault even if you had, or this isn't resolved permanently.) But we never did get any clarity on the details of the issue.