Hostname vs IP address to refer to servers in Windows domain environment

hostnameip addresswindows-server-2008

I've always preferred to use hostname for things like network shares, SQL Server instances, etc. I usually find hostnames to be more descriptive and easier to remember.

However, recently one of our file servers died. It's IP was tied to the network adapter on another server, shares were re-created and almost all jobs that used IP address kept working as nothing happened.

For the jobs where I used hostname I had to go through several dozen of configuration files to change hostname and next day I found out I actually missed a couple. Note that this time I actually used IP address so that when replacement server is online I wouldn't have to change anything again 😀

I realize there is probably a way to create another DNS entry in domain controller and/or network router (instead of re-assigning IP to another server) but it wasn't done that way in this case (not my decision).

Are there some kind of recommended guidelines about how this should be done? What do you do in your environment?

Best Answer

In the case of file servers like you mention, you should be using DFS Namespaces, even if you only have a single file server. This will allow your shares to be referenced by \\domain\share instead of \\server\share. In the event of a failure, you just restore the files to another server and add it to the namespace in place of the original server. The path doesn't change, since it's domain-based.

It also makes file server migrations super easy.

In your case where you had a failure and didn't already have DFSN configured, you should have disabled strict name checking, created a CNAME in DNS with the name of your dead server and point it at the A record for the new server (or just create an A record), and continued happily on with your day.