1825803 Members
2581 Online
109687 Solutions
New Discussion

Re: Hostname query

 
SOLVED
Go to solution
Becke
Super Advisor

Hostname query


Hello Guys,

I'm in the middle of cloning the HP-UX machine, I have copied across the /etc/hosts file to test machine, but when I typed in command 'hostname' it still shows me an old hostname instead of reading the new one from the /etc/hosts file.

Could you please advise which other file I need to look at in order to change the host name successfully, obviously I don't want to change it through SAM as I'm cloning the machine.

Thanks in Advance......
7 REPLIES 7
Adisuria Wangsadinata_1
Honored Contributor
Solution

Re: Hostname query

Hi,

I refer you to run 'set_parms' command :

to change the hostname :
# set_parms hostname

OR for entire initial boot-time dialog sequence :

# set_parms initial

For more details about the command :

# man set_parms

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Becke
Super Advisor

Re: Hostname query

Hi AW,

Thank you very much for your prompt response, I'm running HP verseion 10.01 and because I'm cloning the machine for DR purposes that is why I don't want to change the hostname manually through 'set_parms' or SAM. I need to know which other file I'll have to copy in order to get the hostname right.

I have already copied /etc/hosts file but the machine doesn't read this file to display the new hostname.

Please advise and thanks again...
Becke
Super Advisor

Re: Hostname query


I need to know where does the system look for the hostname locally if it is not hooked up onto the network and DNS is not available.

I would have thought it reads /etc/hosts file locally to pick up the hostname but obviously in this instance its not working, so where else it looks for the hostname locally???
Adisuria Wangsadinata_1
Honored Contributor

Re: Hostname query

Hi Farhan,

Please check the /etc/rc.config.d/netconf.

Actually 'set_parms hostname' just to change the necessary information thru system files on your system. So you dont need to worry that this command will change other information.

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
Becke
Super Advisor

Re: Hostname query


Thanks a lot for your help mate, I will now dump '/etc/rc.config.d/netconf' file from the backup tape. I will then run a hostname command and see if it displays the new hostname...I will let you know soon about this....

Regards,
Raf
Patrick Wallek
Honored Contributor

Re: Hostname query

It will not read the hostname from the netconf file until you reboot or do a '/sbin/init.d/net stop' and then a '/sbin/init.d/net start'.
Becke
Super Advisor

Re: Hostname query


Thanks Patrick for your help, I have just used the set_parms command to change the system's hostname and ip address, as I'm cloning HP-UX version 10.01 server onto a machine which is running HP-UX 10.20, I'm performing a DR exercise and there are issues cloning the operating system due to different hardware and software level, and I'm now manually restoring OS files to recover the 10.01 machine...

This is a bit of hassel as my expertise is AIX, but I have learned a lot from you guys in HP...We have a fantastic team here....
My problem is resolved now....
I will now assign points...
Thank you very much guys...
Raf