Operating System - HP-UX
1832759 Members
2936 Online
110045 Solutions
New Discussion

Best way to change hostname & ip address

 
SOLVED
Go to solution
thewho?
Frequent Advisor

Best way to change hostname & ip address

Hello,
HP-UX 11.0, N4000
I'm going to replace our old N4000 with a new one. The new one is configured, tested and ready all is left to do is change the ip address/hostname so that users start logging in the new N4000. What (and why) would be the best method to do this?

a) "/sbin/set_parms initial" and reboot.

b) edit the /etc/rc.config.d/netconf file and change the appropiate parameters and then reboot.

c) Is there any other way?

Thanks in advance.
Luis
We'll get through this together.
7 REPLIES 7
Sanjay_6
Honored Contributor

Re: Best way to change hostname & ip address

Hi Luis,

"/sbin/set_parms initial" should do the job you want. You can manully edit /etc/rc.config.d/netconf for other information or you can do that thru sam --> networking and communication.

hope this helps.

thanks
linuxfan
Honored Contributor

Re: Best way to change hostname & ip address

Hi Luis,


I don't believe there is a best way to this, its just a matter of preference. Some people prefer just running /sbin/set_parms and not deal with editing multiple files or run multiple commands.

But both the ways do work, i believe its just a matter of preference. But if you are editing files, don't forget /etc/hosts.

-Regards
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Patrick Wallek
Honored Contributor

Re: Best way to change hostname & ip address

I would vote to go with your option A. It will be the cleanest and make sure that all appropriate files are modified.

If you use your option B, then you must make sure that you modify /etc/hosts as well.

Joseph C. Denman
Honored Contributor

Re: Best way to change hostname & ip address

set_parms is easier and modifies the files for you. **Less chance of error due to missing a config file.

You can modify the files yourself, but I would recommend using set_parms and then manually checking the files. Below are a few that I would double check.

/etc/hosts
/etc/nsswitch.conf
/etc/resolv.conf
/etc/rc.config.d/netconf

...jcd...
If I had only read the instructions first??
James R. Ferguson
Acclaimed Contributor
Solution

Re: Best way to change hostname & ip address

Hi Luis:

Running /sbin/set_parms is easy, but so is editing /etc/rc.config.d/netconf -- the choice is really up to you.

Don't forget to change your ROUTE_GATEWAY and your SUBNET_MASK as necessary.

If you are running DNS on the server that is changing, be sure to modify /etc/resolv.conf as necessary on *other* servers.

Regards!

...JRF...
Sanjay_6
Honored Contributor

Re: Best way to change hostname & ip address

Hi,

Also look out for the /etc/nsswitch.conf file.

thanks
Santosh Nair_1
Honored Contributor

Re: Best way to change hostname & ip address

Just my 2 cents on this topic. If you have the luxury of a reboot, then go with the /etc/set_params option. This updates all the proper files and more importantly, the reboot takes care of restarting all the daemons so that they now know the new hostname/IP.
Otherwise, if you can not afford to reboot, you'd have to edit /etc/rc.config.d/netconf, /etc/hosts and then bounce several daemons, including (but not limited to) rpc*, nfsd, nis client/server, swagentd, and a bunch more that I'm missing.

-Santosh
Life is what's happening while you're busy making other plans