LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 08-12-2004, 12:14 PM   #1
mikpos
LQ Newbie
 
Registered: Aug 2004
Posts: 4

Rep: Reputation: 0
hostname


I have fedora2 core installed and I need to change the hostname from localhost.localdomain to another, still maintaining the 127.0.0.1 or the other IP that my network adapter has, but I can I do it???

The last time I've tried this, gdm gave me an error with gnome and it had problem loggin
 
Old 08-12-2004, 12:40 PM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You need to have localhost.localdomain and localhost pointing to 127.0.0.1. You can also point your hostname there or to another IP on another interface.
 
Old 08-12-2004, 07:47 PM   #3
mikpos
LQ Newbie
 
Registered: Aug 2004
Posts: 4

Original Poster
Rep: Reputation: 0
But can I have 2 diferentes hostname for 127.0.0.1?
Can I have 1 hostname for 127.0.0.1 and another one diferent hostname on the same machine with a diferent IP number, not another machine, but the same machine?
If so does will fedore continues to login for the localhost.localdomain has it does in this moment?

att
julio
thanks for the other reply
 
Old 08-12-2004, 10:36 PM   #4
jhayden
LQ Newbie
 
Registered: Mar 2003
Location: Wichita, KS, USA
Distribution: Redhat-7.2,9 Slackware-9.1,10
Posts: 13

Rep: Reputation: 0
Quote:
Originally posted by mikpos
But can I have 2 diferentes hostname for 127.0.0.1?
Can I have 1 hostname for 127.0.0.1 and another one diferent hostname on the same machine with a diferent IP number, not another machine, but the same machine?
I guess I don't understand your questions. Host information should be added to /etc/hosts. Look at man hosts for the format. In my /etc/hosts file, I have 127.0.0.1 being pointed to by localhost and a second hostname. What exactly are you wanting to do?

Josh
 
Old 08-13-2004, 04:00 AM   #5
mikpos
LQ Newbie
 
Registered: Aug 2004
Posts: 4

Original Poster
Rep: Reputation: 0
I want to make a server providing web-services with GRID
 
Old 08-13-2004, 04:42 AM   #6
james.farrow
Member
 
Registered: Mar 2003
Location: UK Darlington
Distribution: Fedora Freebsd Centos
Posts: 296

Rep: Reputation: 31
To change the hostname I think u need to edit 2 files. The 1st is etc/hosts , edit it with vim but LEAVE the the localhost.localdomain alone just TAB then add what u want ie if u want the name 2 b redhat9.redhat.com just add the redhat9, save and exit.Then I think its vim /etc/sysconfig/network and change the line that says localhost.... to redhat9.redhat.com save and exit. Then to see the host name change press CTRL D at the prompt(NO GUI) and the host will change, no reboot required.
 
Old 08-13-2004, 06:52 AM   #7
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
You are using Red Hat, so the file that declares your hostname is
/etc/sysconfig/network This will be persistent thru re-boots


You can set it temporarily with the command hostname
hostname host1.mydomain.com

You will need to log off and on to see the results.
 
Old 08-13-2004, 07:49 AM   #8
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Quote:
Originally posted by mikpos
But can I have 2 diferentes hostname for 127.0.0.1?
Can I have 1 hostname for 127.0.0.1 and another one diferent hostname on the same machine with a diferent IP number, not another machine, but the same machine?
If so does will fedore continues to login for the localhost.localdomain has it does in this moment?

att
julio
thanks for the other reply
You can do something like:
127.0.01 localhost.localdomain localhost myname

Or you can do:
127.0.0.1 localhost.localdomain localhost
192.168.0.2 myname

The "real" hostname will continute to be whatever is reported by the hostname command, which is initially set by the config files specific to your distro.
 
Old 08-27-2004, 02:29 PM   #9
arsongt
LQ Newbie
 
Registered: Oct 2003
Posts: 11

Rep: Reputation: 0
change localhost name for logon

I just want to change then name of "localhost" to my nickname to show at log on. Without changing any configuration since I really dont know much about my network config. since I get my IP detected automatically from the LAN.
 
Old 08-27-2004, 02:38 PM   #10
amfoster
Member
 
Registered: Aug 2004
Distribution: debian, SuSE
Posts: 365

Rep: Reputation: 36
The system's hostname is derived normally from the entry in Red Hat's /etc/sysconfig/network file.

You can bind a hostname to 127.0.0.1 as well. Edit your /etc/hosts file and do something like this:

We will assume a hostname such as host1.example.com

127.0.0.1 localhost.localdomain localhost host1.example.com host1
 
  


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
hostname gururaj Linux - Networking 2 01-05-2006 05:02 PM
hostname changes R153-Ab0V3 Linux - Newbie 6 01-10-2004 11:36 PM
Hostname jpauls104 Slackware 5 07-28-2003 12:16 PM
Hostname _maco_ Linux - General 3 07-07-2003 07:44 PM
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 06:21 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