ascalonx's picture

I'm trying to figure out how to get my appliance to register its hostname with the dns server (much like windows does).  From what I've found online, it appears a standard Ubuntu install uses the dhcp-client3 package for its dhcp client and this has configurations that can be made via /etc/dhcp3/dhclient3.conf to send the hostname when requesting dhcp.

However, it seems that there is no /etc/dhcp3 folder on my appliance, so I can only assume that dhclient3 is not being used as the dhcp client.  Is there another place to make this kind of configuration?



Liraz Siri's picture

Sorry its taken this long to get back to you. We're in the middle of a new release (2009.02) and it's been a bit hectic.

Ubuntu comes with dhcp3-client by default, but we've decided to go with udhcpc as our default dhcp client because it is simpler and smaller while still providing most of dhcp3's functionality.

If you like you can remove udhcpc and install dhcp3-client instead:

$ apt-get remove udhcpc
$ apt-get install dhcp3-client
On the other hand, for the purpose of registering/requesting a hostname during dhcp, they are both configured in the same way - in /etc/network/interface. See section "The dhcp method" in the manual page:
$ man interfaces
In a nutshell, you just have to add the hostname parameter to your configuration like this:
$ cat /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp
   hostname myhostname # hostname to be requested

Hope this helps!
Michael Anselmi's picture

apt-get remove udhcpc
apt-get install dhcp3-client
When I try to install the dhpc3-client I get the following error: Reading package lists... Done Building dependency tree Reading state information... Done Package dhcp3-client is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source I've added a number of other sources to the apt-get sources.list file with no change. Installed samba as a test and it installed fine. Any ideas? Thanks.      
Jeremy Davis's picture

This is a really old thread so likely doesn't apply anymore.

After having a quick look on I can confirm that the dhcp3-client package no longer exists. The only package with a similar name (and somewhat similar function - at least on face value) is isc-dhcp-client. I haven't looked at it closely though, so I'm not 100% sure if it's the same software (just with a new package name) and/or whether it fulfils the same functionality.

Sorry that I can't provide any more clarity.

andenix's picture

I have a configuration where several hosts connected to the Internet through a router. Some are wired and some wireless. One of the hosts called "forum" runs Turnkey PHPBB appliance.


First time its name appeared blank in my router, so as Liraz Siri post suggests,

1) I added this line:

auto eth0
iface eth0 inet dhcp
   hostname forum # hostname to be requested




The name appeared at my router DHCP client list, but the host could not be pinged by its hostname (pinging by ip worked).

2) Once again like the post above suggested I did this:

$ apt-get remove udhcpc
$ apt-get install dhcp3-client

This did not fix the problem, but now I could install samba (next step) without warnings.


3) installing samba

$ apt-get install samba


reboot, no voila I could do:

$ ping forum

from any host in my network!


PS: I am no linux expert so the above could be not very secure and not the best practice either. The ideas are not mine, but a compilation of different posts I found on Turnkey and Ubuntu websites.



Jeremy Davis's picture

DHCP is handy for roaming computers, end-user environments (such as home networks) and developemnt/testing servers but for a static server farm (even if virtual) I prefer to hard code IPs and set those in my nameserver (DNS). Avoiding DHCP (where practical) is a great way of eliminating one potential problem.

andenix's picture

Actually I realized that you don't have to remove udhcpc to be able to lookup your hosts in a LAN, just make sure you configure your hostname through webmin and it matches the one you entered in /etc/network/interfaces.

The problem with DNS in small networks is that not all routers allow you to configure it. Then its a pain, because you will have to either establish DNS and DHCP on a side host, or really hardcode all IPs as you mentioned..

Linux User's picture

With Turnkey Linux Fileserver, I changed hostname in networking hostname. I then went to /etc/networking/interfaces and added the bit about hostname to to the ethernet device.

Graham Stewart's picture

Even after all this time you still need to edit the etc/networks/interfaces to get this to work

Add new comment