Friday, January 16, 2009

How to change hostname on HP-UX 11i

::without reboot

HP-UX 11iv2 and v3 allows you to change the hostname on the fly, so if you want to change the hostname on HP-UX 11i server you can do it without rebooting your server. I have documented here several steps to change the hostname on your HP-UX 11i server.
Steps to change the hostname on HP-UX:

1. First run the hostname command to HP-UX server to change the hostname on HP-UX 11i server:

root@hpuxdev:/> hostname hpuxdev11

I am changing hostname on Integrity Itanium rx6600 running HP-UX 11iv2 from hpuxdev to hpuxdev11

2. Next execute uname command to set the nodename like hostname:

root@hpuxdev:/> uname –S hpuxdev11

running uname with –S option changes the nodename to required hostname value on HP-UX 11i server

3. Change network configuration file (netconf) to make the change permanent during reboots. The netconf files exists

under /etc/rc.config.d direcotory on HP-UX servers

root@hpuxdev:/> cd /etc/rc.config.d/netconf

root@nedunix6:/etc/rc.config.d> vi netconf

Open the netconf file using vi editor and search for HOSTNAME variable, replace the old hostname value to new hostname value. It is recommended by HP to keep the value enclosed in double quotes (" ")

root@nedunix6:/etc/rc.config.d> vi netconf

HOSTNAME="hpuxdev"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1

After changing the HOSTNAME , the netconf file portion with HOSTNAME directives looks like this :

root@nedunix6:/etc/rc.config.d> vi netconf

HOSTNAME="hpuxdev11"
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1

5.Restart the network configuration settings on HP-UX server by running following command .Make sure you run these command from the CONSOLE or MP (Management processor) , sometimes ui have noticed network timeout for few seconds while restarting network settings :

root@hpuxdev:/> /sbin/init.d/net start

Verify changes hostname on HP-UX:

Finally run following commands to make sure hostname and nodename is changed to newer name :

root@hpuxdev:/> hostname

hpuxdev11

root@hpuxdev:/> nodename

hpuxdev11

:with REBOOT

There is a *much* simpler way:

set_parms hostname

Answer a prompt or two, and.... Done!

1 comment:

  1. i want to change the hostname in place of
    aindvh1O to agrdsh0poc...
    root@aindvh1O#
    Perminently i have changed but i want to see agrdsh0poc name in place of aindvh1O

    ReplyDelete