/Changing Hostname OS X Server

Changing Hostname OS X Server

As you may or may not know, I’ve been experimenting with Snow Leopard Server over the past few weeks. I ran into a major DNS issue today when I needed to change the server name.

Being Naive to the beast that is Snow Leopard server I simply went into System Preferences, Sharing and changed the Computer name! Little did I realise the havoc I was about to unleash!

Needless to say after a reboot, all hell broke loose. I was unable to access the server preferences, dns resolution was not working etc. etc. I had pretty much bricked my server!

Can’t Access Server Preferences

It kept saying to couldn’t find the server or it couldn’t authenticate. A little digging revealed that the name change I had performed earlier hadn’t actually changed the dns name of the server or changed it’s internal name resolution.

It turn out changing the name isn’t as simple as one might think!
As I had also changed the IP address (again thinking that I could simply change it under Network settings), I eventually discovered the wonderful command line utility:

changeip

I had to use this to change both the IP and hostname for the OS X Server services.

sudo changeip [oldip]  [newip]  [oldhostname]  [newhostname]

After doing this my hostname was changed – but my problems were not over yet!  The DNS settings were now messed up and although I could perform a hostname lookup, a reverse lookup was not happening and apparently this is very important to Snow Leopard Server!

However I was finally able to login to server preferences.