1761936 Members
3237 Online
108906 Solutions
New Discussion юеВ

HOSTNAME CHANGE

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

HOSTNAME CHANGE

Getting ready to swap IP addresses on two boxes. HP12 becomes HP11 and 11 becomes 12.
What will I need to change, just the hostname with the hostname command and re-configure the network cards with the appropriate ip adress and hostname?

Thanks,
Bob
UNIX IS GOOD
4 REPLIES 4
John Palmer
Honored Contributor
Solution

Re: HOSTNAME CHANGE

Nope, do the following:-

1. Shutdown to single user mode with 'shutdown 0'.
2. Edit /etc/rc.config.d/netconf. This contains the hostname and network configuration info.
3. Edit /etc/hosts (and any relevant DNS configuration if appropriate).
4. reboot.

I do this in single user mode because changing /etc/hosts can cause certain shutdown scripts to 'hang'.

Regards,
John
LucianoCarvalho
Respected Contributor

Re: HOSTNAME CHANGE

Hi Robert,

I think you can do the following.

1 - Edit the files /etc/rc.config.d/netconf on HP11 and HP12 and change the IP-Address and hostname.

2 - If you use /etc/hosts as name resolution, you have to edit this file and change the IP-Address for HP11 and HP12 too, or instead /etc/hosts, you use DNS, you have to change the IP-Address for HP11 and HP12 in the DNS Server database.

3 - Reboot HP11 and HP12.

I hope this help.
Mark Greene_1
Honored Contributor

Re: HOSTNAME CHANGE

I am getting ready to do a similar thing this friday. I ran the script '/sbin/set_parms hostname' to do the hostname change on the box prior to the IP & DNS swap. It ran fine, no problems--just keep in mind that the script reboots the box as the final step.

HTH
mark
the future will be a lot like now, only later
Stefan Schulz
Honored Contributor

Re: HOSTNAME CHANGE

Hi,

as far as i know it is reconmendet using /sbin/set_parms hostname. This will make sure all necessary files are configured correctly.

It also works to edit /etc/rc.config.d/netconf and delete the hostname and IP Adress. During the reboot the system will ask you for the new hostname. In fact it is running set_parms hostname automatically.

Hope this helps

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.