LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 04-06-2003, 10:09 AM   #1
hamster
Member
 
Registered: Apr 2003
Location: Waterford, Ireland
Distribution: Mandrivia 2006.1, Ubuntu 7.10
Posts: 188

Rep: Reputation: 30
Want to set up a new domain name and hostname?


Hi. I'm using RedHat 8.1 for a couple months now and really like a lot fo it's features. I'm trying to set up
a new domain name and hostname without affecting my net utils. This is installed on a laptop with a dial-up
connection.

I know that /etc/hosts defines "localhost" as 127.0.0.1. Can I add or change this to use say some pseudo name like "darkside.com" or can I add a new ip? Should I change /etc/hosts myself or use "redhat-config-network"
I changed it before but it prevented my net utils (ie browser) from resolving net addresses.
 
Old 04-06-2003, 11:17 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
You can use 'hostname' command. It changes your current host name (hostname newname). If you run it without parameters, you'll be shown the current name.
 
Old 04-06-2003, 11:45 AM   #3
hamster
Member
 
Registered: Apr 2003
Location: Waterford, Ireland
Distribution: Mandrivia 2006.1, Ubuntu 7.10
Posts: 188

Original Poster
Rep: Reputation: 30
> hostname ganymede


Yep, that worked it changed the hostname to "ganymede".

However during login I get;

"could not look up internet address for ganymede. This will prevent Gnome from operating correctly. It may be possible to correct the problem by adding ganymede to /ete/hosts.

I logged in anyway and checked /etc/hosts:

127.0.0.1 localhost.localdomain localhost
#127.0.0.1 ganymede.com localhost


The 2nd line was added automatically.... but shouldn't the 1st lined be remmed out instead of the new one? Or is the 1st one always necessary?

Further info......

I tried rebooting and came back to the login screen. The hostname has changed back to localhost.localdomain again. logging in gives me the same message. The /etc/hosts is the same except is:

#127.0.0.1 localhost.localdomain localhost
127.0.0.1 ganymede.com localhost

The only action was the above. Maybe I should use redhat-config-network.







Last edited by hamster; 04-06-2003 at 11:52 AM.
 
Old 04-06-2003, 12:09 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
Add to /etc/hosts:
127.0.0.1 ganymede
Reboot and test if it works.
 
Old 04-06-2003, 12:30 PM   #5
hamster
Member
 
Registered: Apr 2003
Location: Waterford, Ireland
Distribution: Mandrivia 2006.1, Ubuntu 7.10
Posts: 188

Original Poster
Rep: Reputation: 30
Ok, putting in ".com" in ganymede threw it off. I set it to "ganymede" in the /etc/hosts file. I logged out without rebooting and saw the login with the new hostname. Logged in and went online - fine !

Upon reboot however, it has gone back to localhost.localdomain
on the login screen. Hmmm. This is a standard non-modified redhat install...

looking at the /etc/hosts it is still has my changes:

#127.0.0.1 localhost.localdomain localhost
127.0.0.1 ganymede localhost

but hostname cmd comes back with "localhost.localdomain".

Something very small?

Running redhat-config-network shows me me 1 entry "127.0.0.1 name:ganymede alias: localhost"

Surely I shouldn't need to add "hostname ganymede" to some start up script?

Last edited by hamster; 04-06-2003 at 12:33 PM.
 
Old 04-06-2003, 12:56 PM   #6
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,539

Rep: Reputation: 149Reputation: 149
It looks you should...Don't have RH, so I can't find the file it keeps it. There's another way. Open /etc/rc.d/rc.local and add 'hostname ganymede' somewhere at the end. It's one of the startup scripts (the last one), so it won't be changed later.
 
Old 04-06-2003, 01:04 PM   #7
hamster
Member
 
Registered: Apr 2003
Location: Waterford, Ireland
Distribution: Mandrivia 2006.1, Ubuntu 7.10
Posts: 188

Original Poster
Rep: Reputation: 30
Thanks!

Thanks Mara!

I wasn't sure which one to add it to but /etc/rc.d/rc.local has done the trick!

Again really appreciate the help!
 
  


Reply


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
Changing Hostname to Domain Name mikebua56 Linux - Newbie 1 11-06-2005 07:53 PM
Apache domain and hostname bcom Linux - Software 0 05-27-2004 03:35 PM
Wrong Hostname in a MS Domain Zeb Linux - Networking 0 03-16-2004 04:32 AM
hostname vs domain racediver007 Linux - Newbie 5 03-20-2003 04:30 PM
Understanding hostname/domain name SpaceGroove Linux - Newbie 2 01-26-2003 06:42 AM


All times are GMT -5. The time now is 08:06 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration