{"id":1213,"date":"2013-03-12T07:59:06","date_gmt":"2013-03-12T07:59:06","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=1213"},"modified":"2018-09-06T22:59:03","modified_gmt":"2018-09-06T22:59:03","slug":"configure-ip-address-and-dns-from-command-line","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=1213","title":{"rendered":"Configure IP Address and DNS from Command Line"},"content":{"rendered":"<p>The IP address of your computer can be set from the command prompt by running the following commands at an administrative level prompt:<\/p>\n<p><a href=\"http:\/\/microsoftgeek.com\/?attachment_id=1214\" rel=\"attachment wp-att-1214\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright size-full wp-image-1214\" alt=\"CommandPrompt\" src=\"http:\/\/microsoftgeek.com\/wp-content\/uploads\/2013\/03\/CommandPrompt.png\" width=\"48\" height=\"48\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>netsh interface ip set address name=&#8221;Local Area Connection&#8221; static 123.123.123.123 255.255.255.0 123.123.123.1 1<\/p>\n<p>Local Area Connection is the name of the adapter you want to modify. In single NIC systems it is normally called Local Area Connection.<\/p>\n<p>123.123.123.123 is the IP address you want to set.<\/p>\n<p>255.255.255.0 is the subnet mask.<\/p>\n<p>123.123.123.1 is the gateway.<\/p>\n<p>1 is the gateway metric. You can leave this as 1 for almost all cases.<\/p>\n<p>If you want to enable DHCP you can run:<\/p>\n<p>netsh interface ip set address name=&#8221;Local Area Connection&#8221; dhcp<\/p>\n<p>There are two commands for DNS since administrators typically configure a primary and secondary DNS server.<\/p>\n<p>For the primary DNS run:<\/p>\n<p>netsh interface ip set dns name=&#8221;Local Area Connection&#8221; static 208.67.222.222<\/p>\n<p>For the secondary run:<\/p>\n<p>netsh interface ip add dns name=&#8221;Local Area Connection&#8221; 208.67.220.220 index=2<\/p>\n<p>If you want to configure the computer to use DNS from DHCP run:<\/p>\n<p>&nbsp;<\/p>\n<p>netsh interface ip set dnsservers name=&#8221;Local Area Connection&#8221; source=dhcp<\/p>\n<p>When you are finished with all of your IP and DNS changes run ipconfig -all to review the new settings.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The IP address of your computer can be set from the command prompt by running the following commands at an administrative level prompt: &nbsp; netsh interface ip set address name=&#8221;Local Area Connection&#8221; static 123.123.123.123 255.255.255.0 123.123.123.1 1 Local Area Connection is the name of the adapter you want to modify. In single NIC systems it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,1],"tags":[],"class_list":["post-1213","post","type-post","status-publish","format-standard","hentry","category-computer-tech-stuff","category-networking-stuff"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1213"}],"version-history":[{"count":4,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1213\/revisions"}],"predecessor-version":[{"id":2617,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/1213\/revisions\/2617"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}