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" ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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. |
|
|||
|
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 |