cancel
Showing results for 
Search instead for 
Did you mean: 

Can't change hostname

 
Ramones
Frequent Advisor

Can't change hostname

Hi

I have an itanium64 BL860c blade server that I want to change the hostname. After changing hostnames a million times, still I have problems once...so I've changed the hostname on /etc/hosts and /etc/rc.config.d/netconf files, then reboot...when it comes up, the hostname is the original one (before change). I even tried to change with set_parms (no sucess). When set_parms displays the hostname it is the one I've changed, but when I enter hostname it is the old one...what should I do now? Any help?

Thanks,
R
9 REPLIES
Torsten.
Acclaimed Contributor

Re: Can't change hostname

"set_parms" should do it, unless you did not confirm the change.
Can you please capture the session while running set_parms?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Ramones
Frequent Advisor

Re: Can't change hostname

[lxhp820:/] set_parms hostname
_______________________________________________________________________________
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
(example: widget.region.mycorp.com).

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 lxhp820o.
_______________________________________________________________________________

Enter the system name, then press [Enter] or just press [Enter]
to retain the current host name (lxhp820o): lxhp820o

You have chosen lxhp820o as the name for this system.
Is this correct?

Press [y] for yes or [n] for no, then press [Enter] y
_______________________________________________________________________________

Working...
_______________________________________________________________________________
Torsten.
Acclaimed Contributor

Re: Can't change hostname

The current hostname is lxhp820o.
...
Enter the system name, then press [Enter] or just press [Enter]
to retain the current host name (lxhp820o): lxhp820o



But you specify the same name, right?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: Can't change hostname

>> The current hostname is lxhp820o.


The "." is part of the output, not part of the hostname.


I cannot see you changing anything ...

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Ramones
Frequent Advisor

Re: Can't change hostname

Yes, because that's the name I want (it was just to reinforce the idea) .
Even though set_parms displays the new hostname, when I give the command "hostmame" the old hostname is displayed. That's why this is wierd...


Regards,
R
Torsten.
Acclaimed Contributor

Re: Can't change hostname

So you maybe set the "wrong" name somewhere in your startup scripts (profile?), e.g.

hostname

or

export HOSTNAME=other_host_name

Check this!

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Wilfred Chau_1
Respected Contributor

Re: Can't change hostname

did you reboot after renaming the host with set_parms?
Patrick Wallek
Honored Contributor

Re: Can't change hostname

Do you have any backup copies of the netconf file in /etc/rc.config.d? If so, move them elsewhere.

You can have backup copies of files in /etc/rc.config.d but the names have to conform to very specific standards. I find it easier to avoid having unnecessary files in /etc/rc.config.d.
Bob_Vance
Esteemed Contributor

Re: Can't change hostname

Set host name
## hostname goodname

Check host name
## hostname
goodname

If second command returns "goodname", then we know that that works.

Now, if the name is changing after some time or after a reboot to badname, then we know that some script *probably* is changing it.
((It is possible that someone/thing is remoting in and changing it, of course.
))
Try finding that script via something like:

## find /etc /sbin/init.d \
/var/spool/cron/crontabs \
/usr/local/bin \
-type f -exec grep -i -l badname {} \;


This will give the list on of filenames that have "badname" in them.
You can then peruse each one and see what it is doing.


bv
"The lyf so short, the craft so long to lerne." - Chaucer