In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about how CMD and vbs modify IP addresses and DNS. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Modify IP
Cmd / c netsh interface ip set address name= "Local connection" source=static addr=211.82.56.253 mask=255.255.255.0 gateway=211.82.56.1 gwmetric=1
Modify DNS
Cmd / c netsh interface ip set dns name= "Local connection" source=static addr=202.99.192.66
Configure or update the IP address:
Wmic nicconfig where index=0 call enablestatic ("192.168.1.5"), ("255.255.255.0"); index=0 description is to configure network interface 1.
Configure the gateway (default route):
Wmic nicconfig where index=0 call setgateways (192.168.1.1), (1)
Vbs
Const T_GATEWAY = "211.82.56.1" 'Gateway
Const T_NEWDNS1 = "202.99.192.66" 'DNS1
Const T_NEWDNS2 = "60.221.248.43" 'DNS2
StrWinMgmt= "winmgmts: {impersonationLevel=impersonate}"
Set NICS = GetObject (strWinMgmt) .InstancesOf ("Win32_NetworkAdapterConfiguration")
For Each NIC In NICS
If NIC.IPEnabled Then
NIC.SetDNSServerSearchOrder Array (Thousand NEWDNS2)
NIC.SetGateways Array (T_GATEWAY)
End If
Next
Thank you for reading! This is the end of the article on "how CMD and vbs modify IP address and DNS". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.