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

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • 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. How to force a crash dump on T1000/T2000 servers from ALOM
  2. Solaris : How to create processor set (pset) and associate it with a pool
  3. Creating network interface alias for network boot or jumpstart installation at OBP
  4. How to send mails with attachments using the solaris mailx command
  5. How to Identify ZFS Snapshot Differences using “zfs diff”
  6. How to configure Shared Memory Parameters in Solaris 10,11
  7. Howto Verify If a Bootblk is Installed on the Boot Disk (SPARC)
  8. How to delegate SMF management to a non-root user in Solaris
  9. How to delegate NTP service to non-global zone in Solaris
  10. Solaris ZFS : How to Designate Hot Spares in a Storage Pool

You May Also Like

Primary Sidebar

Recent Posts

  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • How Realms Work in Oracle Database Vault
  • How to use Privilege Analysis in Oracle Database
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary