- 积分
- 1267
- 最后登录
- 2024-4-18
- 精华
- 0
- 阅读权限
- 40
- 主题
- 117
- UID
- 1292031
- 帖子
- 2673
- PB币
- 5745
- 威望
- 33
- 贡献
- 0
- 技术
- 7
- 活跃
- 2556
- UID
- 1292031
- 帖子
- 2673
- PB币
- 5745
- 贡献
- 0
- 技术
- 7
- 活跃
- 2556
|
设置本地 DNS 地址,虽然有 DnsJumper 之类的软件,但可惜不支持多个地址和网卡批量添加;
找到一篇《PowerShell设置机器的DNS地址》的文章,比较适用;
https://www.pstips.net/set-dns-address.html
添加修改了 IPv6 的设置和常用 DNS 地址;
可按格式自行修改,注意筛选器可以一次多选网卡。
以下代码另存为 ps1 后缀名,右键点击 PowerShell 运行
- Get-DnsClientServerAddress -AddressFamily IPv4 |
- Out-GridView -PassThru |
- foreach {
- Set-DnsClientServerAddress -InterfaceIndex $_.InterfaceIndex -Addresses '114.114.114.114','223.5.5.5','180.76.76.76','223.6.6.6','1.1.1.1'
- }
- Get-DnsClientServerAddress -AddressFamily IPv6 |
- Out-GridView -PassThru |
- foreach {
- Set-DnsClientServerAddress -InterfaceIndex $_.InterfaceIndex -Addresses '240c::6666','2400:3200::1','2400:da00::6666','2606:4700:4700::1111','2606:4700:4700::1001'
- }
- ipconfig /flushdns
复制代码
|
|