Modify the IP address and DNS server address of the command line in Windows

Source: Internet
Author: User

Every week changes between the lab and the dormitory. The lab's damn public router locks the IP address. The Dynamic IP address is always an incorrect address, and can only be manually modified once. Then I was so lazy and didn't want to open the graphical interface to perform operations. I simply learned how to do this.

Command Format: address ""

Command explanation:

 

Parameters Explanation
Network Connection Network Connection name, which can be found in view network connection in the taskbar
IP address Is your IP address, like 192.168.xxx.xxx
Subnet Mask Usually 255.255.255.255
> Default Gateway It generally ends with. 1 or. 254.
Hops Generally, 1 or auto is used.

 

For example, if I am in a dormitory and the IP address is 10.21.48.254 and the default gateway is 10.21.48.1, run the following command after I return from the lab:

Netsh interface ip address "Ethernet" static 10.21.48.254 255.255.255.0 10.21.48.1 1

Then, if I go from the dormitory to the lab, I will change it to the lab IP Address:

Netsh interface ip address "Ethernet" static 192.168.13.23 255.255.255.0 192.168.13.254 1

In addition, the DNS modification method is similar. Just change the address to dns.

Command Format: dns ""

Command explanation:

Parameters Explanation
Network Connection Network Connection name, which can be found in view network connection in the taskbar
DNS address For example, 114.114.114.114

For example, if you want to change the DNS server address in the lab, you only need to enter:

Netsh interface ip dns "Ethernet" static 114.114.114.114

That's all.

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.