Changing the hostname in Solaris 10

Changing the hostname of a system in Solaris 10 is pretty much the same as in Solaris 9. I'm posting this because I had to look through several pages and piece this process together myself when looking for how to do it.

Follow these steps to rename the system:

  • Change the name in /etc/nodename.
  • Change the name in /etc/hostname.xl0 (where xl0 is the name of your network interface)
  • Change the name in /etc/hosts.
  • Run the command: hostname new_hostname

EDIT: Thanks to eon who submited this information. The file /etc/dumpadm.conf should also be edited and the directory where it puts the dumps must be created. See his comment below.

If anyone knows of any other common files where the hostname is stored, please let us know using the comment system below.


Author: DPAK
Created: Nov 3 2005 (last modified Mar 17 2006)
Categories: Solaris
TechByte #76

Warning: By visiting this site and/or by using any information contained herein, you agree to the Techbytes.ca terms of use.


Comment posted by 'eon' on Mar 15 2006 @ 18:05:24

mkdir /var/crash/new-hostname
/etc/dumpadm.conf
DUMPADM_SAVDIR=/var/crash/new-hostname
Comment posted by 'Mike Madland' on Jun 21 2007 @ 02:27:40
Change the name in /etc/inet/ipnodes also
Comment posted by 'benjas' on Sep 12 2007 @ 15:04:22
i' have tried it but does not work. is there any one with a script to change the hostname.

thanx guys.

Add a comment about this TechByte

If you wish to add a comment regarding this TechByte, please use the form below. Please note that by submitting comments using this form you are allowing all of the information submitted to be visible on this website. Any comments submitted using this form will only be shown on the website if they are approved by the administrators of this site. IF APPROVED, COMMENTS MAY TAKE SEVERAL DAYS TO BE POSTED.

Posted By: (Optional)

Comments:


Other TechBytes: