Flux»Tech


Renaming or Moving a Solaris Host

You need to rename a Solaris host or move it to a new network. Last updated 2008-08-24.

On the surface both these operations sound relatively simple, but there are more things to change than you might suspect. We’ll start with updating the host name, then move on to changing network configuration. These examples have been tested on Solaris 9 and Solaris 10.

NB. I recommend you perform all these changes from the console; you can keep an eye on system state at all times and won’t be disconnected by reboots or changes in network configuration.

Updating a Solaris Hostname

The hostname command can be used to see and edit the current hostname, but changes made with it don’t persist across a reboot. To make a permanent change to your hostname you should update the following files:

You should now reboot your server and check everything comes up OK. Finally, don’t forget to relabel the physical box so you can find it in future.

Moving to a New Network

Sometimes you need to move a server to a totally different network, e.g. moving to a new hosting provider or merging two networks. There are potentially an enormous number of things to update when this happens. This howto sticks to required system changes: I strongly recommend you gather a list of applications used on the server before moving it and check what changes need to be made to them.

Before starting the move, make sure you have all the information needed for each of the steps, e.g. names of new DNS name servers, new IP address. You can learn about the different configuration file formats using the appropriate man pages, for example man resolv.conf.

Naming Services

Ensure your server has entries in naming services (such as DNS, NIS and LDAP) on the new network. Don’t forget to remove the entries on the old network once the server has moved.

Disconnect from Old Network

Before making any configuration changes I’d recommend disconnecting the server from the old network. If you’re physically moving the server you’ll have to do this anyway, so you might as well do it now.

IP Networking

Network Time Configuration

If you use ntpd, you can update the time server in /etc/inet/ntp.conf.

Update Mail (MTA) Configuration

If you use a smarthost this is probably as simple as updating the DS line in /etc/mail/sendmail.cf (this file is generated, so you should update the template in /etc/mail/cf then regenerate it, rather than edit it directly). For more complex configurations refer to the Sendmail documentation: man sendmail.cf is a good start.

NFS Mounts

If your server automatically mounts network shares on other servers you should check they’re available on the new network. If they’re not, it’s best to comment out references to them in /etc/vfstab.

Profile Configuration

You may have web proxies, CVS server roots etc. configured in profile files. It’s a good idea to check /etc/profile, /etc/skel and the profile files of any users.

Connect to New Network

Connect the server up to the new network. I’d recommend you reboot the server (even if it’s not physically moving), that way you will be sure the system will boot correctly in future. If you just want to restart networking on Solaris 10 you can use: svcadm restart svc:/network/physical. You also need to poke mail and ntpd et al. to re-read their configuration if you don’t reboot.

Once the server is up on the new network, you should test it thoroughly and ensure monitoring systems can see it.


Tags: Network, Solaris