如果您看到消息The requested pause, continue, or stop is not valid for this service for DNSCache , Winmgmt , TrustedInstaller,那么您会对这篇文章感兴趣。
net stop dnscache 不工作

如果您无法停止DNS 缓存服务,那么这是因为现在(DNS Cache)Windows操作系统 中进行了更改。Windows 操作系统中的(Windows OS)DNS 客户端服务(DNS Client Service)用于解析DNS。如果之前没有进行过查询,它首先在本地查询或连接到远程DNS服务器。(DNS)重新启动服务是解决任何 DNS 问题(troubleshoot any DNS issue)的方法之一。但是,如果您无法再执行此操作并且已收到请求的暂停、继续或停止对此服务无效,(The requested pause, continue, or stop is not valid for this service)那么此帖子将揭示原因。
请求的暂停、继续或停止对此服务无效
当尝试从命令行 ( net stop dnscache) 或通过转到服务管理单元并打开DNS 客户端(DNS Client)服务来执行任何此类操作时,这些选项被禁用或不可用。
从Windows 10 21H1 和Windows 11开始,对所有用户帐户(包括管理员(Administrator)帐户)禁用所有基于用户的操作。

完整的错误消息如下:
请求的暂停、继续或停止对此服务无效。
键入NET HELPMSG 2191(NET HELPMSG 2191)可获得更多帮助。
净帮助消息 2191
诸如flushdns、displaydns之类的选项可以工作——但不是这个。恼人的部分是如果有变化并且客户端缓存时间很长,将难以访问某些网站。
如果没有重新启动DNS 客户端(DNS Client)的选项,您该怎么办?
您可以使用管理员帐户使用注册表方法更改它。确保(Make)在进行任何更改之前备份您的注册表。
打开运行(Run)提示符,键入 regedit,然后按Enter键
这将打开注册表编辑器
导航:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNSCache\Parameters
右键单击(Right-click)空白区域,然后创建一个新的DWORD。
将 Name 设置为MaxCacheTtl并以秒为单位设置值。默认值为86400秒,即 1 天。
重复相同的操作并创建另一个DWORD,名称为MaxNegativeCacheTtl,值为5
这将确保每隔几个小时刷新一次本地DNS缓存。(DNS)
如何清除客户端 DNS 缓存?
诸如Clear-DnsClientCacheand ipconfig /flushdnsstill 之类的命令可以正常工作,您可以从命令提示符(Command Prompt)或PowerShell中执行它们。两者都(Both)将清除本地缓存,然后在需要时重新启动,应该可以解决问题。
什么是 DNS 解析器缓存?
为了加快将网站名称解析为 IP 地址并因此加载网站,Windows在其本地缓存中维护网站名称到 IP 地址的本地副本。有了这个,浏览器就不需要联系DNS,而是可以使用它。由于它会定期刷新,因此效果很好。
如何查看 DNS 缓存?
在命令提示符下,执行命令ipconfig /displaydns以查看所有网站及其解析的 IP 地址。它将以以下格式提供:
- 记录名称
- 记录类型
- 生存时间
- 数据长度
- 部分
- A(主机)记录
如果您使用PowerShell,则可以使用该Get-DnsClientCache命令。与命令提示符(Command Prompt)的长滚动相比,它提供了更好的可视化。
我希望这篇文章很容易理解,现在您知道为什么在尝试重新启动Services(Services)中的DNS 客户端(DNS Client)时收到错误消息了。
The requested pause, continue, or stop is not valid for this service
If you sеe message The requested pause, continue, or stop is not valid for this service for DNSCache, Winmgmt, TrustedInstaller, then this post will interest you.
net stop dnscache Not working

If you are unable to stop the DNS Cache service, then this is because of a change made in the Windows operating system now. DNS Client Service in Windows OS is used to resolve DNS. It first queries locally or connects to a remote DNS server if the query was not made before. Restarting the service was one of the ways to troubleshoot any DNS issue. However, if you are not able to do it anymore and have received The requested pause, continue, or stop is not valid for this service then this post reveals the reason.
The requested pause, continue, or stop is not valid for this service
When trying to perform any of such operations from the command line (net stop dnscache) or by going to Services snap-in and opening DNS Client service, these options are disabled or not available.
Starting from Windows 10 21H1 and in Windows 11, all user-based operation is disabled for all user accounts, including for the Administrator account.

The full error message goes as:
The requested pause, continue, or stop is not valid for this service.
More help is available by typing NET HELPMSG 2191.
net helpmsg 2191
Options such as flushdns, displaydns work – but not this one. The annoying part is if there is change and the client caching time is high, it will be difficult to access some of the websites.
What can you do if there is no option to Restart the DNS Client?
You can change it using the registry method using an administrator account. Make sure to take a backup of your registry before many any changes.
Open Run prompt, type regedit, and press the Enter key
This will open Registry Editor
Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNSCache\Parameters
Right-click on an empty area, and create a new DWORD.
Set the Name as MaxCacheTtl and set the value in seconds. The default is 86400 seconds which is one day.
Repeat the same and create another DWORD with the name MaxNegativeCacheTtl and value as 5
This will make sure the local DNS cache is refreshed every few hours.
How to Clear Client DNS Cache?
Commands such as Clear-DnsClientCache and ipconfig /flushdns still, work, and you can execute them from the Command Prompt or PowerShell. Both will clear the local cache, and followed by a restart, if needed, should do the trick.
What is the DNS Resolver Cache?
To speed up resolving website name to IP address and hence loading the website, Windows maintains a local copy of website name to IP address in its local cache. When you have this, the browser doesn’t need to contact the DNS and can instead use this. As it is periodically refreshed, it works well.
How to view DNS Cache?
On a command prompt, execute the command ipconfig /displaydns to view all the website and their resolved IP address. It will be available in the following format:
- Record Name
- Record Type
- Time To Live
- Data Length
- Section
- A (Host) Record
If you use PowerShell, you can use the Get-DnsClientCache command. It offers better visualization compared to the long scroll of the Command Prompt.
I hope the post was easy to understand, and now you know why you had received the error when trying to restart the DNS Client in Services.