且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Windows TCP / IP中以编程方式更改NameServer

更新时间:2023-11-30 18:21:34

不要直接更改该注册表项。如您所见,它不会通知DNS客户端名称服务器已更改。

Don't change that registry key directly. As you've found, it doesn't notify DNS clients that the nameserver has changed.

最简单的解决方案可能是%SystemRoot%\ system32\\\
etsh.exe

The easiest solution is probably %SystemRoot%\system32\netsh.exe.

netsh interface ip set dns name="Local Area Connection" source=static addr=...