LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Do I modify 3 files to change hostname? (https://www.linuxquestions.org/questions/linux-newbie-8/do-i-modify-3-files-to-change-hostname-248974/)

imsam 10-29-2004 10:14 PM

Do I modify 3 files to change hostname?
 
Hi,

I realize that the hostname is in multiple files. Here are the ones I'm aware of:
1. /etc/hosts
2. /etc/sysconfig/network
3. /proc/sys/kernel/hostname

If I wanted to change the hostname of my server, do I need to edit all three files then use the hostname MyNewHostName command? Or do I edit just the /etc/hosts file then use the command?

michaelk 10-29-2004 10:29 PM

The /etc/hosts file associates IP addresses to hostnames. If your using a static IP or not using DNS then you will need to change it to reflect the new hostname.

You can use the hostname utility but you will need to change the /etc/sysconfig/network file for the change to be permanent .

No need to modify the /proc.../hostname


All times are GMT -5. The time now is 09:27 AM.