1825160 Members
2275 Online
109679 Solutions
New Discussion юеВ

Host name change

 
SOLVED
Go to solution
Michael Yu_1
Occasional Contributor

Host name change

Anyone knows how to change hostname in the server that has RedHat linux operating system?
Thanks.
2 REPLIES 2
Bill Thorsteinson
Honored Contributor
Solution

Re: Host name change

You need to change several config files under /etc.
If you are registerd with DNS you will also need to have
the DNS records updated.

Primary files are:
/etc/HOSTNAME
/etc/hosts

Review the list from

find /etc -type f -exec grep -qi $(hostname -s) {} \; -print

and change the appropriate files.

Changes to /etc/hosts may
need to occur on other
servers. If you have clients for services, you may need
to update them with the new name.
Bill Thorsteinson
Honored Contributor

Re: Host name change

I forgot to mention that rebooting the server is
recommended.

If you can't reboot, you can use the hostname command to
change the servers idea of its name. You will also have
the hostname in their configuration such as:
sendmail; samba; and bind (DNS).