LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Hostname (https://www.linuxquestions.org/questions/linux-newbie-8/hostname-734819/)

deibertine 06-22-2009 01:47 PM

Hostname
 
Hi there,

Is there a way to "statically" assign a hostname into a linux box?

I've tried adding the hostname into the hosts file and even configured system-network-config thru gui and assign it there but it doesnt stay on the host name I wanted it to.

I have CentOS 64bit and want to assign a static hostname: devqa-csaa12.csaa.com

Everytime I reboot it goes back to localhost.localdomain

System is not part of the domain/workgroup.

Just need someone to give me an advise on this.

Thanks!

DB :o

rich_c 06-22-2009 02:27 PM

In /etc/sysconfig/network add a line that says HOSTNAME=whatever_you_want

deibertine 06-22-2009 03:00 PM

Quote:

Originally Posted by rich_c (Post 3582643)
In /etc/sysconfig/network add a line that says HOSTNAME=whatever_you_want

That did it, Thanks!:D

farslayer 06-22-2009 03:18 PM

For a more thorough guide to setting a Linux hostname check out my Blog Entry

Cheers.


All times are GMT -5. The time now is 11:57 PM.