天下·网吧联盟论坛网友dvxcheng问:
批处理改本机DNS的批处理,其它不变,只要求改DNS。谢谢!
天下·网吧联盟论坛网友llmmllmm答:
netsh interface ip set dns name="本地连接" source=static addr=200.200.200.200
说明 200.200.200.200 是你要改的dns
天下·网吧联盟论坛网友dvxcheng加问:
如果要填2个DNS呢,只需要再加一行 addr=xx.xx.xxx.xx吗
有的机子本地连接是 本地连接1 有的本地连接2......各种都有,因为有的换过网卡,批处理需要怎么样写
天下·网吧联盟论坛网友 哈哈的快 答:
netsh interface ip set dns "本地连接" static 202.103.24.68 primary
netsh interface ip add dns "本地连接" 202.103.44.150
把上述IP改成你自己的DNS可以添加2个DNS
天下·网吧联盟论坛网友dvxcheng加问:
如果有本地连接1、本地连接2等连接名称呢?那怎么办
天下·网吧联盟论坛网友 哈哈的快 答:
你不用管他是本地连接几,用上面的批处理就可以了,只要你的网络连接里面有 “本地连接”几个字,就可以改
天下·网吧联盟论坛网友 bing614 答:
给你份VBS的
On Error Resume Next
temp=0
set wshshell=wscript.createobject("wscript.shell")
'启动WMI服务
wshshell.run ("%comspec% /c regsvr32 /s scrrun.dll"),0,True
wshshell.run ("%comspec% /c sc config winmgmt start= auto"),0,True
wshshell.run ("%comspec% /c net start winmgmt"),0
wshshell.run ("%comspec% /c sc config NetMan start= auto"),0,True
wshshell.run ("%comspec% /c net start NetMan"),0
strComputer = "."
Set objWMIService = Getobject("winmgmts:\\" & strComputer & "\root\cimv2")
'得到当前活动网卡ID
Set colItems = objWMIService.ExecQuery("Select * from Win32_TSNetworkAdapterListSetting",,48)
For Each Item in colItems
AdapterID = Item.NetworkAdapterID
Next
'禁NETBIOS
Set reg = WScript.CreateObject("WScript.Shell")
reg.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces\Tcpip_"&AdapterID&"\NetbiosOptions","2","REG_DWORD"
'更改DNS
Set reg = WScript.CreateObject("WScript.Shell")
reg.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces\"&AdapterID&"\NameServer","202.96.128.68,202.96.128.143,202.96.128.166,202.96.128.86","REG_SZ"
'禁NETMAN服务
Set reg = WScript.CreateObject("WScript.Shell")
reg.RegWrite "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Netman\Start","4","REG_DWORD"
msgbox "更改完成,请重启网卡!"
天下·网吧联盟论坛网友 zwfgdlc 答:
把这段保存成REG文件
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces\{5D236A07-B75C-435A-9162-72ABB674DE56}]
"NameServer"="202.96.128.86,202.96.128.166"
把{5D236A07-B75C-435A-9162-72ABB674DE56}这段改成你自己的,导入注册表就行了,即时生效.
天下·网吧联盟论坛网友 llmmllmm 答:
添加多个dns:
netsh interface ip set dns name="本地连接" source=static addr=1.1.1.1
netsh interface ip add dns name="本地连接" addr=2.2.2.2 index=2
netsh interface ip add dns name="本地连接" addr=3.3.3.3 index=3
编注:index=?为多个DNS的顺序索引
欢迎访问最专业的网吧论坛,无盘论坛,网吧经营,网咖管理,网吧专业论坛https://bbs.txwb.com |
关注天下网吧微信,了解网吧网咖经营管理,安装维护:
本文来源:天下网吧联盟论坛 作者:佚名