Home » Featured, Tip & tricks

Changing hostname in Solaris 10

paan 14 February 2008 Featured, Tip & tricks 1,158 views One CommentPrint This Post Print This Post Email This Post Email This Post

I’ve been using Linux for sometime now and changing hostname in Linux has always been a simple matter of changing the /etc/hostname file or running the ‘hostname” command. Changing hostname is Solaris 10 however is a little more cumbersome than that.

Host name in Solaris 10

The files that you need to change to change the hostname are:

  • /etc/hostname.<interface>
  • /etc/nodename
  • /etc/hosts
  • /etc/inet/ipnodes

The /etc/host file that contain the ip address and all the hostname that is resolved to that specific ip adress. Find the interface’s ip address and change the old hostname to the new one.
All the other file contain just the hostname, so change the content of the files to match the new hostname. If you have multiple network interfaces, then you will have, for example, /etc/hostname.eth0, /etc/hostname.eth1 and so on.

If you are not planning to restart the machine, then you need to run the ‘hostname <new hostname>’ command and also rename “/var/crash/<oldhostname>” to “/var/crash/<newhostname>”. But if you are planinng to restart anyway then the system will create the /var/crash/hostname and use the new hostname on startup.

edit:(22/2/08) After some more testing, it seems that some application are a little more finicky about hostname changes than others. So I would suggest you to rename the “/var/crash/<oldhostname>” and run the “hostname” command  directory regardless weather you will restart the machine or not.I had trouble with certain configurations of kerberos if those steps are not done even if I restarted the machine.

Hope you like your new hostname. :D

Digg!
Rate this:
2.5

One Comment »

  1. Changing hostname in Solaris 10 « Monster Servant

    Simple post on how to change the hostname on a solaris 10 machine. Solaris 10 have some quirks that can cause headache to users that are used to using linux.

Have your say!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>