LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-07-2008, 07:20 PM   #1
dudeman41465
Member
 
Registered: Jun 2005
Location: Kentucky
Distribution: Debian
Posts: 794

Rep: Reputation: 56
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?
 
Old 07-07-2008, 08:07 PM   #2
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
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.
 
Old 07-07-2008, 08:46 PM   #3
uncle_philip
Member
 
Registered: Apr 2008
Location: sydney
Distribution: centos5.2
Posts: 50

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


Reply



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
Change HOSTNAME Belize Slackware 8 01-04-2005 03:42 PM
Change hostname garlam Slackware 2 10-13-2004 02:19 AM
How to change hostname oldoldcat Linux - General 14 02-05-2004 11:48 PM
Hostname change AttOMIXT Linux - Newbie 2 11-01-2003 11:10 PM
Change Hostname? mikeshn Linux - General 2 01-15-2003 05:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:29 AM.

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