LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 08-20-2007, 09:52 PM   #1
esgaroth
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Rep: Reputation: 0
hostname changed


somehow i think my computers hostname has been changed. I am using fedora 7. When I turn on the computer I am prompted to login to laptop instead of localhost. So that after I log on it says username@laptop. I dont think I changed anything that would have anything to do with the computers hostname, and I dont really know how to change it back. My hosts file only contains the line 127.0.0.1 localhost.localdomain localhost.
/etc/sysconfig/network says the hostname is localhost.localdomain and /etc/hostname appears to be blank.
 
Old 08-21-2007, 12:09 AM   #2
tajamari
Member
 
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Rep: Reputation: 30
Quote:
Originally Posted by esgaroth View Post
somehow i think my computers hostname has been changed. I am using fedora 7. When I turn on the computer I am prompted to login to laptop instead of localhost. So that after I log on it says username@laptop. I dont think I changed anything that would have anything to do with the computers hostname, and I dont really know how to change it back. My hosts file only contains the line 127.0.0.1 localhost.localdomain localhost.
/etc/sysconfig/network says the hostname is localhost.localdomain and /etc/hostname appears to be blank.
Have you rebooted your machine?
 
Old 08-21-2007, 12:56 AM   #3
esgaroth
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
yes, several times.
 
Old 08-21-2007, 10:11 PM   #4
esgaroth
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
So does anyone know what I need to do to fix this? Is there any other information I should provide that would help?
 
Old 08-21-2007, 10:21 PM   #5
tajamari
Member
 
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Rep: Reputation: 30
Quote:
Originally Posted by esgaroth View Post
So does anyone know what I need to do to fix this? Is there any other information I should provide that would help?
what's the result when you typed uname -a?
 
Old 08-21-2007, 11:24 PM   #6
esgaroth
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Linux laptop 2.6.22.1-41.fc7 #1 SMP Fri Jul 27 18:10:34 EDT 2007 i686 i686 i386 GNU/Linux
 
Old 08-22-2007, 04:14 AM   #7
tajamari
Member
 
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Rep: Reputation: 30
Quote:
Originally Posted by esgaroth View Post
Linux laptop 2.6.22.1-41.fc7 #1 SMP Fri Jul 27 18:10:34 EDT 2007 i686 i686 i386 GNU/Linux
have you tried changing the /etc/sysconfig/network entries? replace laptop with the hostname you want, then reboot
 
Old 08-22-2007, 06:28 AM   #8
oli
Member
 
Registered: Jun 2007
Location: Australia
Distribution: Centos and Fedora
Posts: 34

Rep: Reputation: 16
I don't think you need to edit any files to set the hostname. The command 'hostname' is there to do that. Try 'man hostname' to see what it'll let you do.
 
Old 08-22-2007, 06:35 AM   #9
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 61
True; however what the hostname command does is not saved between reboots, hence the need to put the value into /etc/sysconfig/network.
Startup scripts are written in a way that hostname is called with the name you put in the config file.

Yves.
 
Old 08-22-2007, 06:54 AM   #10
oli
Member
 
Registered: Jun 2007
Location: Australia
Distribution: Centos and Fedora
Posts: 34

Rep: Reputation: 16
That's what the --file switch is for I guess.
 
Old 08-22-2007, 09:54 PM   #11
esgaroth
LQ Newbie
 
Registered: Jan 2005
Posts: 15

Original Poster
Rep: Reputation: 0
Well as I said in the original post the /etc/sysconfig/network file says the hostname is localhost. Here are the actual contents of the file:
NETWORKING=yes
HOSTNAME=localhost.localdomain
 
Old 08-22-2007, 11:20 PM   #12
livetoday
Member
 
Registered: Jun 2006
Location: India
Distribution: RHEL,Suse,Fedora
Posts: 106

Rep: Reputation: 15
your system might be picking up the name from the local DNS.

Quote:
Originally Posted by esgaroth View Post
Well as I said in the original post the /etc/sysconfig/network file says the hostname is localhost. Here are the actual contents of the file:
NETWORKING=yes
HOSTNAME=localhost.localdomain
 
Old 08-23-2007, 12:18 AM   #13
tajamari
Member
 
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252

Rep: Reputation: 30
Quote:
Originally Posted by esgaroth View Post
Well as I said in the original post the /etc/sysconfig/network file says the hostname is localhost. Here are the actual contents of the file:
NETWORKING=yes
HOSTNAME=localhost.localdomain
replace HOSTNAME=localhost.localdomain to HOSTNAME=mylaptop.intra.yourdomain.com or any host you prefer, save then reboot. edit it using vi.
 
  


Reply

Tags
command, edit, 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 not being changed irfanhab Linux - Networking 3 07-31-2006 03:53 PM
Knoppix Changed Hostname deadlove75 Linux - Software 4 04-10-2006 12:15 PM
hostname changed - why? greg108 Fedora 3 12-31-2004 07:41 PM
hostname changed. was i hacked???????? Sridhar Guntur Linux - Networking 7 07-23-2004 11:34 AM
changed hostname now problems degraffenried13 Linux - General 2 02-21-2004 06:15 PM


All times are GMT -5. The time now is 02:58 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration