Use the batch command to set the Windows system's IP address and DNS attached drawings _dos/bat

Source: Internet
Author: User
Find the corresponding network card name

Using commands: ipconfig
Copy Code code as follows:

Ipconfig/all

Windows IP Configuration

Host Name ............:d501-4-3
Primary Dns Suffix ...:
Node Type ............:unknown
IP Routing Enabled ... : No
WINS Proxy Enabled ... : No

Ethernet Adapter Local Area Connection:

Connection-specific DNS Suffix. :
Description ........... : Marvell Yukon 88E8057 pci-e Gigabit
Ethernet Controller
Physical Address ..... . : 44-37-E6-1D-5B-F1
Dhcp Enabled ...... : No
IP address. ...........:192.168.1.111
Subnet Mask ........... : 255.255.255.0
Default Gateway ..... . : 192.168.1.1
DNS Servers ........... : 8.8.8.8

We now need to set the network card name is "Local Area Connection", IP address is 192.168.1.111, subnet mask is 255.255.255.0,dns address is 8.8.8.8

Set IP and DNS to be automatically acquired

To use the command:
netsh interface ip set address "Local Area Connection" DHCP
netsh interface ip set DNS "Local Area Connection" DHCP

Copy Code code as follows:

netsh interface ip set address "Local Area Connection" DHCP
Are you sure.

netsh interface ip set DNS "Local Area Connection" DHCP
Are you sure.

Equivalent operation:


Set IP and DNS to fixed values

To use the command:
netsh interface ip set address "Local Area Connection" static [IP address] [subnet mask] [gateway] [Gateway long jump points: general fill 1]
netsh interface ip set DNS "Local Area Connection" static [DNS address]
Copy Code code as follows:

netsh interface ip set address "Local Area Connection" Static 192.168.1.111 255.255.255.0 192
.168.1.1 1
Are you sure.

netsh interface ip set DNS "Local Area Connection" static 8.8.8.8
Are you sure.

Equivalent operation:

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.