LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-15-2003, 01:27 PM   #1
endfx
Member
 
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105

Rep: Reputation: 15
changing localhost


I'm confused on how to change the name of my machine from localhost. when I type "hostname testmachine" it changes the name to testmachine, but when I reboot, the name is changed back to localhost
I have edited the /etc/hosts file, but this doesn't seem to do anything.
Can anybody tell me how to change the name of my machine to something else (ie so the prompt reads:
[endfx@testmachine /]$ )
Thanks
 
Old 05-15-2003, 02:05 PM   #2
manthram
Member
 
Registered: Feb 2002
Location: Fairfax, VA
Distribution: RedHat 8, Mandrake9.1, Slack9
Posts: 456

Rep: Reputation: 31
put you host name in the file '/etc/hostname'

and please use the search before you post a question.
 
Old 05-15-2003, 03:27 PM   #3
endfx
Member
 
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105

Original Poster
Rep: Reputation: 15
sorry, I should have mentioned this above
I don't have the file /etc/hostname
Thats whats confusing me. It seems to be getting the hostname from somewhere else everytime I boot.
As mentioned above I changed /etc/hosts and used the hostname command to change it, neither of which seem to be working. I'm using mandrake9.1
Am I missing something very simple here? thanks
 
Old 05-15-2003, 03:37 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Try using:
hostname yourhost.com
 
Old 05-15-2003, 04:14 PM   #5
cyberskye
Member
 
Registered: Feb 2003
Location: The City by the Bay
Posts: 116

Rep: Reputation: 15
Put the desired hostname in front of localhost.domain localhost in /etc/hosts. I believe that should do it.

Quote:
I'm confused on how to change the name of my machine from localhost
You don't really want to remove localhost - there's software that needs it.

Skye
 
Old 05-15-2003, 05:23 PM   #6
manthram
Member
 
Registered: Feb 2002
Location: Fairfax, VA
Distribution: RedHat 8, Mandrake9.1, Slack9
Posts: 456

Rep: Reputation: 31
create a the file '/etc/hostname' network will see if the file is there. if it is it will read form there.

or you can put the line below in the file '/etc/sysconfig/network'

HOSTNAME=yourhostname
 
Old 05-15-2003, 05:27 PM   #7
endfx
Member
 
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105

Original Poster
Rep: Reputation: 15
Thanks, thats what I needed
I added the line HOSTNAME=whatever to /etc/sysconfig/network
that worked, thx
 
  


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
Changing from localhost? purelithium Mandriva 3 11-08-2005 07:52 PM
Changing localhost name aje Linux - General 1 11-11-2004 10:23 PM
Changing name from localhost jbraum Mandriva 9 01-17-2004 01:04 AM
changing Localhost.localdomain Brother Michael Linux - Newbie 6 08-18-2003 09:01 PM
Changing localhost@localdomain??? TMMO Linux - Networking 2 08-10-2003 11:52 PM

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

All times are GMT -5. The time now is 09:27 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