Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I understand that changing the host name/computer name for a Windows based machine (Client or Server) requires a reboot. I realize that once a computer name is changed, a pending machine name is stored in the system registry and is applied on next boot. I was not able to find much technical documentation on exactly WHY this was required.

Can someone please point me in the right direction on the technical challenges behind why a host name change is not complete without a system reboot ?

share|improve this question
Added a comment to the accepted answer with a link to an MSDN article on why a reboot is required. – Ameer Deen Aug 19 '13 at 5:15
up vote 54 down vote accepted

You don't have to restart immediately after renaming the machine... just don't expect every service and function to pick up on the new name.

Things such as system environment variables are read once, at system startup. If you change those variables, the various components of Windows won't pick up on them until they're restarted. Some of those components are so deeply integrated with the OS, you might as well restart the entire OS.

Many Windows services and applications, both those written by Microsoft as well as 3rd party, that use the system's hostname, typically only read it once at startup and never read it again.

I know if I was writing an application that read the machine's hostname, it would be pretty silly of me to periodically poll for it just in case it changed.

In an operating system such as Linux, you see the same thing. You can change the hostname without rebooting, but you do have to restart some very basic components of the system in order to get them to pick up on the new name. Linux is more modular than Windows, although Windows has come a long way in terms of modularity.

One way to detect whether a Windows system is pending a computer rename operation is to check the registry. If the contents of




are not the same, that means the system has a pending rename operation that will complete the next time the system reboots.

share|improve this answer
Thanks for the tip Ryan. I looked up the code for System.Environment.MachineName (using dotnetpeek). It uses the GetComputerName function in Kernel32.dll which: "Retrieves the NetBIOS name of the local computer. This name is established at system startup, when the system reads it from the registry." (…). In other words, you're right its simply cached on startup. Just wanted some documentation to back it up. Thanks. – Ameer Deen Aug 18 '13 at 17:58

Here's a script for skipping the reboot:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.