1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Welcome to GadgetBit!

We are a community of technology enthusiats.

If you are already a registered member then you can login here

If you are new to the site then why not join up? It will only take a couple of minutes to register, by doing so all adverts will be removed from the site. You can register here or you can use your Facebook or Twitter account.

Configure IP Address and DNS from Command Line

By Creaky · Oct 11, 2015 ·
  1. Creaky
    The IP address of your computer can be set from the command prompt by running the following commands at an administrative level prompt:
    netsh interface ip set address name="Local Area Connection" static 1
    Local Area Connection is the name of the adapter you want to modify. In single NIC systems it is normally called Local Area Connection.
    Code: is the IP address you want to set. is the subnet mask. is the gateway.
    1 is the gateway metric. You can leave this as 1 for almost all cases.

    If you want to enable DHCP you can run:
    netsh interface ip set address name="Local Area Connection" dhcp
    There are two commands for DNS since administrators typically configure a primary and secondary DNS server.

    For the primary DNS run:
    netsh interface ip set dns name="Local Area Connection" static
    For the secondary run:
    netsh interface ip add dns name="Local Area Connection" index=2
    If you want to configure the computer to use DNS from DHCP run:
    netsh interface ip set dnsservers name="Local Area Connection" source=dhcp
    When you are finished with all of your IP and DNS changes run ipconfig -all to review the new settings.

    Share This Article


To make a comment simply sign up and become a member!