Hostname we use for identifying the systems in the network and few services / application configurations.
If you are using HP Unix operating system on the server or on HP Virtual Machines and for any reason, If you want to change the hostname, then here is the very simple steps for you, you can change the hostname with just by giving single command.
You can change the hostname of your system just by giving “hostname <hostname>” command, but it is for temporary only, after reboot the hostname will change to old hostname so for changing the hostname for permanent there is 2 ways but it require system reboot :
1. Use SAM.
2. Use the below single command to change the hostname permanently :
#set_param hostname <newhostname>
Currently my server has testserver hostname,
Now I wanted to change the hostname as testserver1,
testserver #set_parms hostname testserver1
For the system to operate correctly, you must assign it a unique
system name or “hostname”. The hostname can be a simple name
(example: widget) or an Internet fully-qualified domain name
A simple name, or each dot (.) separated component of a domain name, must:
* Start with an uppercase or lowercase letter.
* End with a letter or digit.
* Contain only letters, digits, underscore (_), or dash (-).
The underscore (_) is not recommended.
* Contain no more than 63 characters per component.
* Contain no more than 255 total characters.
* Each dot (.) separated component of a domain name, can start
with a digit.
NOTE: The first or only component of a hostname should contain no more
than 8 characters and the full hostname should contain no more
than 63 characters for maximum compatibility with HP-UX software.
The current hostname is testserver.
Enter the system name, then press [Enter] or just press [Enter]
to retain the current host name (testserver): testserver1 (here again I gave new hostname i.e. testserver1)
You have chosen testserver1 as the name for this system.
Is this correct?
Press [y] for yes or [n] for no, then press [Enter] yes
Your changes will not take effect until you reboot the system.
Do you want to reboot now?
Press [y] for yes or [n] for no, then press [Enter] y
Shutdown at 16:10 (in 0 minutes)
*** FINAL System shutdown message from root@testserver ***
System going down IMMEDIATELY
System shutdown time has arrived
reboot: redirecting error messages to /dev/console
Now after rebooting the server, Login to server and give below command to verify that new hostname applied or not:
yawww …. hostname changed 🙂