How do I get a good hostname

This is a discussion on How do I get a good hostname within the Linux Networking forums, part of the Linux Forums category; My linux machine is in a network where the IP addresses are assigned using DHCP. I use "dhcpcd" ...


Go Back   Usenet Forums > Linux Forums > Linux Networking

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-14-2004
rick
 
Posts: n/a
Default How do I get a good hostname

My linux machine is in a network where the IP addresses are assigned
using DHCP. I use "dhcpcd" to get the IP address but it also mangles
my machine's hostname (probably because the DHCP server is not properly
configured). Is there a way to query the DNS server for the correct
hostname from the assigned IP address and assign it? Can this be
automated? (e.g. Hostname [rick@622526421 rick]$).

Thanks
rick

Reply With Quote
  #2 (permalink)  
Old 02-14-2004
James Knott
 
Posts: n/a
Default Re: How do I get a good hostname

rick wrote:

> My linux machine is in a network where the IP addresses are assigned
> using DHCP. I use "dhcpcd" to get the IP address but it also mangles
> my machine's hostname (probably because the DHCP server is not properly
> configured). Is there a way to query the DNS server for the correct
> hostname from the assigned IP address and assign it? Can this be
> automated? (e.g. Hostname [rick@622526421 rick]$).
>
> Thanks
> rick
>


Well, you could try using the host command with your IP, to find out what
the dns server thinks you are.

--

Fundamentalism is fundamentally wrong.

To reply to this message, replace everything to the left of "@" with
james.knott.
Reply With Quote
  #3 (permalink)  
Old 02-15-2004
P Gentry
 
Posts: n/a
Default Re: How do I get a good hostname

rick <rick@gold.com> wrote in message news:<pan.2004.02.14.16.23.58.178185@gold.com>...
> My linux machine is in a network where the IP addresses are assigned
> using DHCP. I use "dhcpcd" to get the IP address but it also mangles
> my machine's hostname (probably because the DHCP server is not properly
> configured). Is there a way to query the DNS server for the correct
> hostname from the assigned IP address and assign it? Can this be
> automated? (e.g. Hostname [rick@622526421 rick]$).
>
> Thanks
> rick


Your ISP probably needs to generate a hostname for you to place in its
DNS records and for internal accounting. As you can see, the names
are pretty unsightly -- in fact, downright ugly.

If you just need something more presentable for local use you can edit
the /etc/hosts file to include a more suitable name. This is just
another name for localhost.localdomain (or actually the canonical name
in this case, I believe).

Eg.,
[user@pbrain]$ cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 pbrain localhost.localdomain localhost

man hosts to see hows it's formated. Or try a GUI network config tool
to make a name for yourself -- literally!

Note that this name will not be useful in any other context. If
you're looking for a "good" name to use for public, outside access,
you can try one of the dynamic DNS services such as:
http://www.dyndns.org/
or some ISPs will (for a fee) let you pick your own name.

hth,
prg
email above disabled
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:29 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0