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