LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-22-2009, 01:47 PM   #1
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Rep: Reputation: 30
Question 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
 
Old 06-22-2009, 02:27 PM   #2
rich_c
Member
 
Registered: Apr 2008
Location: UK
Distribution: PeppermintOS
Posts: 387
Blog Entries: 74

Rep: Reputation: 81
In /etc/sysconfig/network add a line that says HOSTNAME=whatever_you_want
 
Old 06-22-2009, 03:00 PM   #3
deibertine
Member
 
Registered: Mar 2009
Posts: 222

Original Poster
Rep: Reputation: 30
Talking

Quote:
Originally Posted by rich_c View Post
In /etc/sysconfig/network add a line that says HOSTNAME=whatever_you_want
That did it, Thanks!
 
Old 06-22-2009, 03:18 PM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
For a more thorough guide to setting a Linux hostname check out my Blog Entry

Cheers.
 
  


Reply

Tags
hostname


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hostname issue - showing "localhost" instead of actual hostname. ryes31 Linux - Server 9 12-12-2012 08:19 PM
hostname -f error hostname :unknownhost prnkho Linux - Newbie 1 11-26-2008 09:12 AM
hostname rstmn957 Mandriva 4 09-22-2003 09:23 AM
hostname rstmn957 Red Hat 2 09-10-2003 11:51 AM
hostname command vs. $HOSTNAME env. variable Silly22 Linux - Networking 2 03-29-2002 05:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration