Change DNS code sharing with the registry _dos/bat

Source: Internet
Author: User

The most into my DNS is always intermittent, very unstable, Guangzhou area, if your DNS often need to replace, try this batch processing,

Forum A lot of people have made changes to DNS batch processing, but the change Process batch processing Wait a bit slow, there are comrades in the local connection has 2 to N, the change is very inconvenient.

Batch content:

Copy Code code as follows:

echo off
REGEDIT/S \\\\server\\xx\\xx.reg
Cls

\\\\server\\xx\\xx.reg for your long distance road., do not use my, just modify the red part for your remote road strength,

The following is the registry key for DNS, and mine is 2000,

Copy Code code as follows:

Windows Registry Editor Version 5.00

[hkey_local_machine\\system\\controlset001\\services\\tcpip\\parameters\\interfaces\\{ B130BF2A-0BD5-4B4D-B3A9-55A94FC46694}]
"UseZeroBroadcast" =dword:00000000
"EnableDeadGWDetect" =dword:00000001
"EnableDHCP" =dword:00000000
"IPAddress" =hex (7): 31,00,39,00,32,00,2e,00,31,00,36,00,38,00,2e,00,32,00,2e,00, 32,00,30,00,31,00,00,00,00,00
"SubnetMask" =hex (7): 32,00,35,00,35,00,2e,00,32,00,35,00,35,00,2e,00,32,00,35, 00,35,00,2e,00,30,00,00,00,00,00
"DefaultGateway" =hex (7): 31,00,39,00,32,00,2e,00,31,00,36,00,38,00,2e,00,32,00, 2e, 00,32,00,35,00,34,00,00,00,00,00
"Defaultgatewaymetric" =hex (7): 31,00,00,00,00,00
"NameServer" = "202.96.128.166,61.144.56.100"
"Domain" = ""
"DisableDynamicUpdate" =dword:00000000
"Enableadapterdomainnameregistration" =dword:00000000
"InterfaceMetric" =dword:00000001
"Tcpallowedports" =hex (7): 30,00,00,00,00,00
"Udpallowedports" =hex (7): 30,00,00,00,00,00
"Rawipallowedprotocols" =hex (7): 30,00,00,00,00,00
"Ntecontextlist" =hex (7): 30,00,78,00,30,00,30,00,30,00,30,00,30,00,30,00,30,00, 32,00,00,00,00,00
"Dhcpclassidbin" =hex:
"DHCPServer" = "255.255.255.255"
"Lease" =dword:00000e10
"Leaseobtainedtime" =dword:45090a44
"T1" =dword:4509114c
"T2" =dword:45091692
"Leaseterminatestime" =dword:45091854
"Ipautoconfigurationaddress" = "0.0.0.0"
"Ipautoconfigurationmask" = "255.255.0.0"
"Ipautoconfigurationseed" =dword:92437cc6
"AddressType" =dword:00000000

Save Reg and put it in your server remote shared directory, just modify the above red font DNS for your own DNS.

If someone doesn't know how to do it remotely, for example,

For example, my server name is sever, the share name created on the server is xx$ $ to hide, you can add or not,

I saved the registry entry as A.reg, so I put the A.reg registry in the xx$ shared directory,

The batch process is written like this:

Copy Code code as follows:

echo off
REGEDIT/S \\\\server\\xx$\\a.reg
Cls

Save bat, throw this batch to the startup item on it, start running, 1 seconds on the change, timely and effective, no slow waiting!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.