Mac OS X Server

Mac OS X Server: Changing IP Addresses

Unlike many flavors of the *nix beast you do not want to change the IP address of a Mac OS X Server without thinking it through very carefully first.  The IP address that you used when you initially set the system up is the one it would prefer to use for the rest of its life if it were left to its own devices. If you do insist on changing the IP address it’s usually best to do so before you configure services.  If you can’t then you can change the IP address with services running but prior to doing so please make sure to perform a clone of your local hard drive and run the appropriate changeip scripts.  

The changeip script needs a directory service followed by an old ip address, followed by a new ip address, followed by an old hostname, follwed by a new host name in order to run.  Sounds like a lot but it’s pretty straight forward.  One thing to be careful with is that you always include the old and new host name even if you’re only changing the actual IP address.  In this case you would only be listing the same host name twice but it will save you from having problems getting the command to parse properly.  To run the changeip script:

changeip -v /LDAPv3/127.0.0.1 10.00.9 10.0.0.10 apple.oreilly.com apple.oreilly.com

There are multiple scripts for various services now in Leopard.  Once you’ve run the changeip script for the server if you are running Open Directory, Mail or Jabber then you should run the changeip_ds, changeip_mail or changeip_jabber scripts respectively.

Note: You can also use the changeip script to prepare for a host name change in much the same way that you would use it to change an IP address.

The changeip command can also be used to check the host name of the system you are using.  To do so:

changeip -checkhostname