LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Hostname Change (https://www.linuxquestions.org/questions/linux-software-2/hostname-change-654194/)

dudeman41465 07-07-2008 07:20 PM

Hostname Change
 
How do I go about permanently changing the hostname of my machine? I run:
Code:

hostname mybox
as root and it changes, but upon restarting my computer it goes back to being localhost, is there any way to make sure the change is permanent?

KenJackson 07-07-2008 08:07 PM

Try this:
cat /etc/sysconfig/network

Do you see a line that says "HOSTNAME=myoldbox" ? I know that's the primary place I edited to change it.

And since I use static addressing, I also edited /etc/hosts, though you won't have to if you accept the default with DHCP.

If you have configured postfix, maybe you'll have to edit the "myhostname=" line /etc/postfix/main.cf.

uncle_philip 07-07-2008 08:46 PM

I changed under /etc/hosts,
format as,
ip-addr hostname.domain.name hostname


All times are GMT -5. The time now is 06:47 PM.