Operating System - HP-UX
1829949 Members
1890 Online
109998 Solutions
New Discussion

How to change the hostname

 
Lynette Guanzon
Occasional Contributor

How to change the hostname

Hello,
I tried to use set_parms to change the hostname, but after a reboot it went back to the original hostname. I also tried the "unsupported" method by changing the ff:
/etc/hosts
/etc/rc.config/netconf

To no avail, it still comes back with the old hostname after a reboot. What else can I do so that the system keeps the new hostname?

I appreciate any assistance.
Thank you,
Lynette
11 REPLIES 11
Charles McCary
Valued Contributor

Re: How to change the hostname

change /etc/rc.config.d/netconf
- will handle reboot

change /etc/hosts

do the hostname command again.

Sachin Patel
Honored Contributor

Re: How to change the hostname

Hi
How long is your hostname. It needs to be less then 8 char or you will have problem

Sachin
Is photography a hobby or another way to spend $
Lynette Guanzon
Occasional Contributor

Re: How to change the hostname

Hi Charles,
I tried that one too but it still did not work.
Any other ideas?

Thanks,
Lynette
Charles McCary
Valued Contributor

Re: How to change the hostname

What is your current hostname?
do a hostname command to find out.

What do you want to change it to?

Lynette Guanzon
Occasional Contributor

Re: How to change the hostname

Hi Sachin,
My hostname is only 7 characters long. The only difference between the old and new hostname is the last character (a digit change).
Lynette Guanzon
Occasional Contributor

Re: How to change the hostname

Hi Charles,
The old hostname is techfw2. The new hostname is techfw1. What I do then to get around it is to set the hostname manually after every reboot. So currently, since I changed it manually, it has the new hostname of techfw1.
Charles McCary
Valued Contributor

Re: How to change the hostname

Sachin Patel
Honored Contributor

Re: How to change the hostname

Hi
you are on right track
only two file plays part on it. /etc/hosts and /etc/rc.config.d/netconf.

After changing this two file, brought system in single user mode and check the name.

Try changing to different name like star2.
do you use DNS for name resolv?

Sachin
Is photography a hobby or another way to spend $
Lynette Guanzon
Occasional Contributor

Re: How to change the hostname

Hi Charles,
Thanks for the link, but I've read this before already.

Hi Sachin,
Yes we are using DNS. I will try to bring it down to single user mode. I'll let you know as soon as this is done.

Thank you to both of you!
MANOJ SRIVASTAVA
Honored Contributor

Re: How to change the hostname

Hi Lynette

SAM--->Networkin and Communications --->Network Interface Card ----> ACTION Field ( modify System Name )

Sometimes SAM does the magic tooo.


Manoj Srivastava

Charles McCary
Valued Contributor

Re: How to change the hostname

Lynette,

If still unsuccessful, please provide the output from the following commands:

# grep techfw /etc/hosts
# grep techfw /etc/rc.config.d/netconf
# hostname
# uname -a

This will help me to help you.

tx,

C