Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 7th, 2003, 06:22 PM
Dean7 Dean7 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 11 Dean7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
How do I globally change my host name?

When I first installed my RedHat Linux 8 I had my DSL connection active. After the install I noticed that it automatically assigned a host name based on my ISP connection. Now when ever I log in or need to reference my host name I faced with the following name:

ip96.dhcp86.ptldor0.nwlink.com

I really don't want to live with such a long host name. I don't know what host name would have been assigned if I had left the DSL connection disconnected during the install process. Does anyone know, short of having to re-install my RH Linux, how I can globally change my host name to a name of my choosing (a much shorter name)?

Thanks,

Dean

Reply With Quote
  #2  
Old June 8th, 2003, 03:18 AM
Trellph Trellph is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Location: Home
Posts: 75 Trellph User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to Trellph
to change your hostname, type "hostname blah"


Allthough your hostname IS what the ISP gives you.
__________________
</stuff>

Reply With Quote
  #3  
Old June 8th, 2003, 10:54 AM
Dean7 Dean7 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 11 Dean7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you Trellph. However, this seems to only change the host name temporarily. Upon reboot this assignment goes away. The "Welcome to" login screen still shows the long host name.

In the past, someone had a post recommending going to the Main Menu/System Setting/Network and doing an edit under the Hosts tab. I can assign an alias however it's only an alias, and does not substitute the long host name for the shorter alias in the Welcome login screen. Also, if I'm setting up my own server and want my own shorter host name, it seems I'm still stuck with the long host name the ISP provides.

I'm not an experienced Linux user, but I am continuing my education in Linux, but still have a lot of gaps to fill in yet. I'm sure there's something that will allow me to do this, I just don't know what yet.

Thanks again,

Dean

Reply With Quote
  #4  
Old June 9th, 2003, 05:58 PM
frymaster frymaster is offline
hubris, loathing, technology
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: http://frymaster.ca
Posts: 76 frymaster User rank is Private First Class (20 - 50 Reputation Level)frymaster User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 h 27 m 57 sec
Reputation Power: 8
/etc/HOSTNAME

usually this is where yr hotname is stored.

Reply With Quote
  #5  
Old June 9th, 2003, 08:00 PM
Dean7 Dean7 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 11 Dean7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the reply Frymaster. I didn't find anything called "hostname" in the /etc directory, however I did find a file with my host name in it called "hosts" in the /etc directory. Unfortunately there is a warning in this file to not delete this line (I assume this also means editing as well), "...or various programs that require network functionality will fail."

I think I'm stuck with the very long host name, until I can purchase a domain name. Although, I'm not sure that this is necessary with a workstation (non-server) setup.

dean7

Reply With Quote
  #6  
Old June 9th, 2003, 08:33 PM
Hero Zzyzzx's Avatar
Hero Zzyzzx Hero Zzyzzx is offline
11
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jul 2001
Location: Lynn, MA
Posts: 4,635 Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level)Hero Zzyzzx User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 4 Days 23 h 44 m 19 sec
Reputation Power: 77
Send a message via AIM to Hero Zzyzzx
Hmm. I've never seen this problem, and I also have dynamically assigned hostnames via my PPPOE ADSL provider.

/etc/hosts is kind of like a global DNS override thing. You can use it to map IPs to names, it isn't used to set your hostname (AFAIK).

You should be able to set your hostname in the /etc/sysconfig/network file. Whatever you set it to, be sure to put that same hostname on the 127.0.0.1 line in your /etc/hosts file to make sure your loopback interface is setup properly for your new domain name.

Taking these steps should make a permanent change. And you don't need a FQDN for a workstation.

Reply With Quote
  #7  
Old June 9th, 2003, 11:35 PM
Dean7 Dean7 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 11 Dean7 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Okay Hero Zzyzzx, this sounds promising.

I went to my /etc/sysconfig/network file, and it had the following in it:

NETWORKING=yes
HOSTNAME=localhost.localdomain

What would I type below the current HOSTNAME line to indicate that my HOSTNAME is also something other than "localhost.localdomain"? Or would I overwrite it with my desired (new) host name?

Here is my /etc/hosts file content starting after the comment lines:

127.0.0.1 localhost.localdomain localhost
ip9.dialup.dhcp84.nwlink.com Lemma

Lemma is the name I would like to show up instead of the "ip9..." name. It's showing up here because I added this as an "alias" name in the Main Menu/System Setting/Network configuration utility (in Gnome) and entering it under the Hosts tab. However I found that an alias is just what is says it is, and does not replace the longer "ip9..." name.

Also, what would I put in my "/etc/hosts" file?

Do I replace the "localhost.localdomain" after the HOSTNAME in the /etc/sysconfig/network file with "Lemma", and then replace "ip9.dialup.dhcp84.nwlink.com" in the /etc/hosts file with "Lemma"?

I would be very thankful if you would show me what to enter in these files.

Thank you for you help.

Dean

Last edited by Dean7 : June 9th, 2003 at 11:39 PM.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > How do I globally change my host name?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate 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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway