建立一个 .bat 批处理文件(切回外网)
netsh interface ip set dns "本地连接" static "192.168.1.XX" primary
netsh interface ip add dns "本地连接" "192.168.1.XXX"(可以不要)
IP 为你外网IP
建立一个 .bat 批处理文件(切回内网)
netsh interface ip set dns name="本地连接" source=static addr="192.168.1.XX"
IP 192.168.1.XX 为你内网IP
转载于:https://www.cnblogs.com/kaixing/archive/2012/03/30/2424783.html