Configuration hints for self-managed Linux Machines

DNS Search Domain

At least Debian releases up to Debian 6.0 Squeeze and Ubuntu releases up to Ubuntu 11.04 Natty (and maybe other Linux distributions) have a bug in their default DHCP client which causes search domain suffixes with multiple domains to fail.

There are several solutions and workarounds available:

  • Upgrade to a newer release of Debian or Ubuntu. Debian 7.0 Wheezy and Ubuntu 11.10 Oneiric should suffice.
  • If the computer is just used at ETH D-PHYS or if you don't care if your current domain is also part of the domains being searched for given hostnames, the easiest way to fix the issue is to create a file at /etc/dhcp/dhclient-enter-hooks.d/hardcode-domain-in-search-debian-bug-567141 with the following content: domain_in_search=Yes
  • Remove quoting around "$new_domain_search" in /sbin/dhclient-script, line 26 (on Debian 6.0 Squeeze, or nearby on Ubuntu). Example code change:

Before:

26                 for domain in "$new_domain_search"; do
27                         if [ "$domain" = "$new_domain_name" ]; then
28                                 domain_in_search="Yes"
29                         fi
30                 done

After:

26                 for domain in $new_domain_search; do
27                         if [ "$domain" = "$new_domain_name" ]; then
28                                 domain_in_search="Yes"
29                         fi
30                 done

You may need to make this modification again after a security update of the isc-dhcp-client package.

Sending Hostname for Dynamic DNS

If you want your Linux host accessible via dynamic DNS at <yourhost>.dhcp.phys.ethz.ch, make sure that send host-name is used in /etc/dhcp/dhclient.conf.

For more recent versions of ISC's dhclient, the following line in /etc/dhcp/dhclient.conf should suffice:

send host-name = gethostname();

Older versions may need an explicit name there. Please use a name without domain, e.g.

send host-name "johns-laptop";

If nobody else uses that name, you remotely can access your computer by using e.g. johns-laptop.dhcp.phys.ethz.ch (continuing the example from above).