| Fedora This forum is for the discussion of the Fedora Project. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-20-2007, 09:52 PM
|
#1
|
|
LQ Newbie
Registered: Jan 2005
Posts: 15
Rep:
|
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.
|
|
|
|
08-21-2007, 12:09 AM
|
#2
|
|
Member
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252
Rep:
|
Quote:
Originally Posted by esgaroth
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?
|
|
|
|
08-21-2007, 12:56 AM
|
#3
|
|
LQ Newbie
Registered: Jan 2005
Posts: 15
Original Poster
Rep:
|
yes, several times.
|
|
|
|
08-21-2007, 10:11 PM
|
#4
|
|
LQ Newbie
Registered: Jan 2005
Posts: 15
Original Poster
Rep:
|
So does anyone know what I need to do to fix this? Is there any other information I should provide that would help?
|
|
|
|
08-21-2007, 10:21 PM
|
#5
|
|
Member
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252
Rep:
|
Quote:
Originally Posted by esgaroth
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?
|
|
|
|
08-21-2007, 11:24 PM
|
#6
|
|
LQ Newbie
Registered: Jan 2005
Posts: 15
Original Poster
Rep:
|
Linux laptop 2.6.22.1-41.fc7 #1 SMP Fri Jul 27 18:10:34 EDT 2007 i686 i686 i386 GNU/Linux
|
|
|
|
08-22-2007, 04:14 AM
|
#7
|
|
Member
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252
Rep:
|
Quote:
Originally Posted by esgaroth
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
|
|
|
|
08-22-2007, 06:28 AM
|
#8
|
|
Member
Registered: Jun 2007
Location: Australia
Distribution: Centos and Fedora
Posts: 34
Rep:
|
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.
|
|
|
|
08-22-2007, 06:35 AM
|
#9
|
|
Senior Member
Registered: Jul 2004
Location: Nantes (France)
Distribution: Arch Linux
Posts: 1,897
Rep:
|
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.
|
|
|
|
08-22-2007, 06:54 AM
|
#10
|
|
Member
Registered: Jun 2007
Location: Australia
Distribution: Centos and Fedora
Posts: 34
Rep:
|
That's what the --file switch is for I guess. 
|
|
|
|
08-22-2007, 09:54 PM
|
#11
|
|
LQ Newbie
Registered: Jan 2005
Posts: 15
Original Poster
Rep:
|
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
|
|
|
|
08-22-2007, 11:20 PM
|
#12
|
|
Member
Registered: Jun 2006
Location: India
Distribution: RHEL,Suse,Fedora
Posts: 106
Rep:
|
your system might be picking up the name from the local DNS.
Quote:
Originally Posted by esgaroth
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
|
|
|
|
|
08-23-2007, 12:18 AM
|
#13
|
|
Member
Registered: Jul 2007
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252
Rep:
|
Quote:
Originally Posted by esgaroth
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 03:28 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|