After installing Windows Server 2008 Core you may wish to configure a static IP address and DNS servers.  Microsoft guides you through this process using the Netsh command.

Configuring a Static IP Address in Windows Server 2008 Core

Use Netsh to configure the static IP address:

netsh interface ipv4 set address name="Local Area Connection" source=static address=192.168.100.48 mask=255.255.255.0 gateway=192.168.100.254

Configuring the Primary DNS Server in Windows Server 2008 Core

Use Netsh again to configure the primary DNS server address:

netsh interface ipv4 set dns name="Local Area Connection" source=static address=192.168.100.49 primary

Configuring Additional DNS Servers in Windows Server 2008 Core

Use Netsh to configure a secondary DNS server address:

netsh interface ipv4 add dnsserver name="Local Area Connection" address=192.168.100.48 index=2

The static IP and DNS server configuration will now be shown in IPConfig:

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Network Connection
   Physical Address. . . . . . . . . : 00-0C-29-31-9E-AC
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::1884:ed1b:1548:43be%2(Preferred)
   IPv4 Address. . . . . . . . . . . : 192.168.100.48(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.100.254
   DNS Servers . . . . . . . . . . . : 192.168.100.49
                                       192.168.100.48
   NetBIOS over Tcpip. . . . . . . . : Enabled

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. mstech

    Thanks Paul.

  2. arestao

    it’s so borning to create two process in order to set primary and standby dns.

  3. Rui Miranda

    >netsh interface ipv4 set dns name=”Wireless Network Connection” source=static address=212.113.191.129 primary

    The configured DNS server is incorrect or does not exist.

    …What gives?

    1. Robert Sanders

      Its attempting to reach the DNS server after configuring it. This is a normal operation – I run into this issue as well when I point to inaccessible or non-existent DNS when running these commands.

      Confirm you can reach that IP and are allowed to create queries. Might be worth using public like 8.8.8.8 for testing.

  4. bitwalker

    hi,
    the “index=2” doesn’t work for me, to add an address as a secondary dns. It says that ‘index’ is not a valid argument.

    1. Scott

      G’day.
      Replying in case anyone else finds this problem. Not that the command is “add” , not “set” when you are specifying index=2

      e.g.:
      netsh interface ipv4 add <—- (not "set" which is when you are setting the primary dns"

  5. hasan

    hi

    i want to configur core server as adtitional DC how can i make it

    many thanks

  6. Brian

    Hello, when you run the command ‘netsh interface ipv4 set dnsservers ?’ the “Remarks:” section mentions the use of an ‘addr’ option for specifying a static list of DNS server IP addresses, but doesn’t show an example of the syntax how to use this option! Do you know the proper syntax?

    1. Paul Cunningham

      I see an syntax example when I check that same help info.

      set dnsserver “Local Area Connection” static 10.0.0.1 primary

      That is one example. “Addr” is just an abbreviation for the “address” option.

  7. Mike

    I usually never post comments, but look through the web to try and find adding secondary DNS, and this is the only one that work. Thanks.

  8. Con Stantine

    well done bro,
    whole hour i was looking this commands….

    good job

Leave a Reply