How to set the hostname and primary DNS suffix name in Server Core

Home > Search > How-to
  by

Before configuring the hostname, the hostname command can be typed in the command line prompt to see the current hostname. In this example, the hostname is ServerCore1.

C:\Users\Administrator> hostname
ServerCore1

To change the hostname:

  1. Type netdom renamecomputer <currentname> /newname:<newname> and press enter (example: netdom renamecomputer ServerCore1 /newname:Eng-DNS1)
  2. When prompted "Do you want to proceed (Y or N)", press y and press enter
  3. The computer will need to be restarted to complete the changes. Type shutdown /r /t 0 and press enter to reboot the machine immediately.

Note: This is also a good time to update the DNS suffix. The ipconfig /all command may not have anything listed in Primary DNS Suffix.

  1. Type netdom computername <hostname> /add:<computername>.<dns suffix name>.local and press enter (example: netdom computername Eng-DNS1 /add:Eng-DNS1.example.local)
  2. Type netdom computername <hostname> /makeprimary:<computername>.<dns suffix name>.local and press enter (example: netdom computername Eng-DNS1 /makeprimary:Eng-DNS1.Engineering1.local)
  3. The computer will need to be restarted to complete the changes. Type shutdown /r /t 0 and press enter to reboot the machine immediately.
  4. The ipconfig /all command can be used to verify that the Primary DNS Suffix has been set.

  1. Type powershell and press enter to use Windows powershell
  2. Type Add-Computer -WorkGroupName <dns suffix name> -Restart (example: Add-Computer -WorkGroupName Engineering1 -Restart).

Warning! This will restart the services on the server.

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments