[IT Network] Configuring IP Address and DNS via Windows Command Line

Usually when we want to change the IP address and DNS on P C / Notebook which is using Windows-based operating system, we always go to control panel then go to the network. For those who are familiar about changing the IP Address and DNS from the command line on the LINUX / UNIX based, surely he will get this feeling. Well,  the same thing on LINUX / UNIX OS, we can also make changes to IP addresses and DNS via command line. To do something like that, we need a command that is

netsh interface ip set address name = “ethernet interface name us” and static ip_address subnet_mask gateway metric”

For example, we want to change the IP address as data shown below:

IP Address           : 192.168.0.2

Subnet Mask        : 255.255.255.0

Gateway               : 192.168.0.1

DNS Primary       : 192.168.0.3

DNS Secondary  : 192.168.0.4

Metric Gateway: 1 (usually is  1)

So, those datas abouv

Thus, the data mentioned above if you want to put through the command line is as follows:

netsh interface ip set address name=”Local Area Connection” static 192.168.0.2 255.255.255.0 192.168.0.1 1


Then to set its DNS is as follows:

netsh interface ip set dns name = “Local Area Connection” static 192.168.0.3

netsh interface ip set dns name = “Local Area Connection” 192.168.0.4 index = 2

After running all these commands, make sure the IP address and DNS was already configured well by verifiying it using the command ipconfig / all


netsh interface ip set address name=”Local Area Connection”
0 0 votes
Article Rating


We are teams that have the same hobbies in Information Technologies and have experienced in many fields regarding Information Technologies .

Related Articles

Subscribe
Notify of
guest
1 Comment
Inline Feedbacks
View all comments
Hartono

Good

3
0
Would love your thoughts, please comment.x
()
x