• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to change hostname in Solaris 8, 9 and 10

by admin

How to change hostname in Solaris 11

There are basically 2 ways to change the hostname in Solaris 10 and below. The post describes both these methods and also how to change hostname or IP address in Non-Global zones.

1. Using the sys-unconfig Command

sys-unconfig command restores the system’s configuration to an “as-manufactured” state, ready to be reconfigured again. This includes IP address, hostname, Name resolution choice, Time zone etc.

# sys-unconfig

The system needs to reboot after you run this command. It takes you through all the configuration steps when you first install the OS, like hostname, IP address, DNS settings, time zone etc..

2. Changing hostname without running sys-unconfig command

You can also change the hostname or IP address without the using the sys-unconfig command. this too requires a reboot.

For Solaris 10
Edit the below files and replace the old hostname and/or IP address wherever applicable.

/etc/inet/hosts
/etc/nodename
/etc/hostname.[interface]

In the last file, the interface is the primary interface that is being used in the system (for example e1000g0). This file may contain just the IP address. In that case you may leave the file unchanged, unless you want to change the IP address of the system too.

For Solaris 9 and below
For Solaris 9 and below, we need to also edit below files :

/etc/net/ticlts/hosts
/etc/net/ticots/hosts
/etc/net/ticotsord/hosts

Reboot the system
Reboot the system gracefully for the changes to take effect :

# shutdown -i6 -g0 -y

3. Changing hostname/zone-name or IP address in Non-global zone

1. Login into the zone and edit the below files :

/etc/inet/ipnodes
/etc/inet/hosts

2. From the Global zone change the zone’s configuration :

root@global # zonecfg -z my-zone
root@global # zonecfg:my-zone> set zonename=new_name
root@global # zonecfg:newzone> commit
root@global # zonecfg:newzone> set address=x.x.x.x  (where x.x.x.x is the new address)
root@global # zonecfg:newzone> end
root@global # zonecfg:newzone> verify
root@global # zonecfg:newzone> commit
root@global # zonecfg:newzone> exit

3. Reboot the zone

root@global # zoneadm -z my-zone reboot

Other files to be edited

Now the hostname entry is added to many other files mentioned below. Make sure you edit these files to change them to have the new hostname.

--> /etc/hosts
--> /etc/dfs/dfstab
--> /etc/vfstab on the NFS clients
--> Cronjobs where old hostname entries were used
--> Scripts having the old hostname entry
How to change hostname in Solaris 11

Filed Under: Solaris, Zones

Some more articles you might also be interested in …

  1. Troubleshooting solaris 10 boot issues related to SMF and milestones
  2. How to install a ZFS boot block in solaris
  3. Examples of adding static routes in Solaris
  4. Solaris ZFS : How to Create and Manage Mirrored Storage Pools
  5. What are the Solaris process tools
  6. How to mount the zfs rpool while booted from CD [SPARC]
  7. Oracle VM Server for SPARC (Ldoms) : How to Change Primary/Control Domain’s UUID
  8. Managing boot environments in Solaris 11
  9. How to set inactivity timeouts for logins and shells in Solaris
  10. How to Kill Zombie (Defunct) Process in Solaris

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright