I was recently faced with having to change the domain name on a Mac OS X Server. If I had to do this on a Windows machine, it would be a relatively simple process using a GUI interface. However, on a Mac server, there isn't (as of version 10.6.8) a way to change the fully qualified domain name (FQDN) via a GUI. Thankfully, there is a way to change the domain settings using the CLI and it's a piece of cake.
The changeip command was created to allow administrators to change the ip address and FQDN in static config files on a Mac OS X Server. For example, if you setup the DNS and iCal services, instead of manually updating the config files associated with these services, simply running the changeip command updates the files for you.
The syntax for the command is as follows: