Networking Forums

Networking Forums > Computer Networking > Linux Networking > How do I get a good hostname

Reply
Thread Tools Display Modes

How do I get a good hostname

 
 
rick
Guest
Posts: n/a

 
      02-14-2004, 03:24 PM
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
 
 
 
 
James Knott
Guest
Posts: n/a

 
      02-14-2004, 07:42 PM
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
 
P Gentry
Guest
Posts: n/a

 
      02-14-2004, 11:26 PM
rick <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> 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
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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/bin/hostname Vwaju Linux Networking 4 08-25-2008 07:56 PM
What is a cheap/ good omni antana to buy? or the good one lotukitten Wireless Internet 2 10-18-2007 12:22 AM
Hostname Bit Twister Linux Networking 26 09-23-2004 06:27 AM
Assign a 2nd hostname Jeff Windows Networking 1 05-27-2004 12:55 AM
hostname resolution Curtis Matz Linux Networking 1 11-29-2003 05:45 PM



1 2 3 4 5 6 7 8 9 10 11