Bootstrap FreeKB - Windows Server Core - netdom command (set the hostname and primary DNS suffix name)
Windows Server Core - netdom command (set the hostname and primary DNS suffix name)

Updated:   |  Windows Server Core articles

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.

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


March 21 2021 by Md Nur Islam
Thanks, It's very helpful

Add a Comment


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