1827218 Members
2111 Online
109716 Solutions
New Discussion

hostname modification

 
SOLVED
Go to solution
Bruno Dostie
Advisor

hostname modification

I have recovered an HP-UX 10.20 server using an Ignite tape. During recovery I ran in options to modify hostname ans IP address.
Nodename and IP address have been applied, but hostname is always the name of the original server. I have tried "set_parms hostname" command to modify hostname without results. "hostname returns original name value. if I uses hostname newservername, and reboot system, original servername is back again.

Any idea ?
DOSB
9 REPLIES 9
Camel_1
Valued Contributor

Re: hostname modification

Pls check the following config files

/etc/rc.config.d/netconf
/etc/hosts

Simon
Slawomir Gora
Honored Contributor

Re: hostname modification

Hi,


chech HOSTNAME variable in file
/etc/rc.config.d/netconf
Bharat Katkar
Honored Contributor

Re: hostname modification

HI,
# set_parms hostname
should work and it takes care of all associated files.
You only have to update /etc/hosts with the proper hostname and IP address.
If you want to change both IP and Hostname better to use:

# set_parms initial

And try setting the hostname and Ip address alongwith subnet mask and all required network configuration.
This will reboot the server and it should work fine with the new name.

After reboot check by
#hostname
command.

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Bruno Dostie
Advisor

Re: hostname modification

netconf file contents:
HOSTNAME=newservername
OPERATING_SYSTEM=newservername

etc/hosts file contents:
ddd.ddd.ddd.ddd newservername


uname -n command returns newservername
hostname command returns originalservername
DOSB
Sridhar Bhaskarla
Honored Contributor
Solution

Re: hostname modification

Hi Bruno,

Look for any 'old' netconf files under /etc/rc.config.d/ directory.

#cd /etc/rc.config.d
#grep 'oldservername' *

See if there are any files that look like netconf file but with different names.

All the files in this directory will be sourced during the system startup. So, if there are any file that have "HOSTNAME="oldname"" line, then unexpected results can occur.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
RAC_1
Honored Contributor

Re: hostname modification

The script /sbin/init.d/hostname sets the hostname. The file also talks about nodename.

Do you have same setting for both??

Do as follows.

/etc/set_params hostname
uname -S "hostname" (this will set nodename)
Check files and make sure they reflect correct setting.

/etc/hosts (make sure that hostname entry is just bellow the loopback entry)
/etc/rc.config.d/netconf

Anil

There is no substitute to HARDWORK
Borislav Perkov
Respected Contributor

Re: hostname modification

Hi,

#set_parms initial

will solve your problem.

Regards
Bruno Dostie
Advisor

Re: hostname modification

Sridhar pointed directly on my problem....

in etc/rc.config.d directory
two files named netconf and netconf_990625

solution:
1- from there, I have created a directory named oldfiles, put netconf_990625 in this brand new directory,

2- replaced
HOSTNAME=newservername by
HOSTNAME="newservername" I don't know if it may have incidence but it works now


rebooted and everythings are OK.

thanks to all for your quick responses.
DOSB
Bill Hassell
Honored Contributor

Re: hostname modification

This is a common but very critical issue: NO temp or archive files allowed in /etc/rc.config.d! If you need to keep old copies, create a parallel directory lie etcrc.config.d.old and move old copies there. During bootup, *every* file in /etc/rc.config.d is executed in alphabetical order.


Bill Hassell, sysadmin