<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.18.0">
</HEAD>
<BODY>
On Tue, 2008-03-18 at 23:15 -0400, Jim Kinney wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
    You will need to have a host section for each machine identifiable by MAC address. In that section you can spec a host name to be applied. For example, I want my inkjet to always have the following settings:<BR>
    <BR>
    host HP_1100 {<BR>
    &nbsp; hardware ethernet 00:01:e6:6a:89:ff;<BR>
    &nbsp; fixed-address <A HREF="http://192.168.0.3">192.168.0.3</A>;<BR>
    &nbsp; option host-name &quot;HP Inkjet 1100&quot;;<BR>
    }<BR>
    <BR>
    It will get the domain name from the earlier setting.<BR>
</BLOCKQUOTE>
<BR>
I had tried that (because a few of the devices on my network require static IP addresses), but the farthest this seems to go is the DNS server.<BR>
<BR>
It seems that if I want the domain name to actually be applied to the clients, I have to use a shell script as a hook into the DHCP client on the workstations.&nbsp; The following DHCP script seems to have done it, though it's probably slightly buggy:
<PRE>
#
# Update the system's domain name when a new DHCP lease is received.&nbsp; This
# is probably specific to Ubuntu (and maybe Debian) systems that use 127.0.1.1
# for the system's hostname/domainname.
#
# Install this file in /etc/dhcp3/dhclient-exit-hooks.d for it to become
# effective.
#
# Copyright (c) 2008 Michael B. Trausch &lt;mike@trausch.us&gt;, Released under the
# terms of the GNU GPL v3.
#

set_system_domain_name() {
&nbsp;&nbsp;&nbsp; NDN=&quot;$new_domain_name&quot;
&nbsp;&nbsp;&nbsp; HN=`hostname`
&nbsp;&nbsp;&nbsp; NEW=&quot;127.0.1.1 $HN.$NDN $HN \\# Updated by SSDN&quot;

&nbsp;&nbsp;&nbsp; sed &quot;s|.*127.0.1.1.*|$NEW|g;&quot; -i /etc/hosts 
&nbsp;&nbsp;&nbsp; return 0
}

release_system_domain_name() {
&nbsp;&nbsp;&nbsp; HN=`hostname`
&nbsp;&nbsp;&nbsp; NEW=&quot;127.0.1.1 $HN&quot;

&nbsp;&nbsp;&nbsp; sed &quot;s|.*127.0.1.1.*|$NEW|g;&quot; -i /etc/hosts 
&nbsp;&nbsp;&nbsp; return 0
}

case $reason in
&nbsp;&nbsp;&nbsp; BOUND|RENEW|REBIND|REBOOT)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set_system_domain_name
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;
&nbsp;&nbsp;&nbsp; EXPIRE|FAIL|RELEASE|STOP)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; release_system_domain_name
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;
esac
</PRE>
When I have a valid lease, this gives me the following in my <TT>/etc/hosts</TT> file:
<PRE>
127.0.0.1 localhost
127.0.1.1 sage.spicerack sage # Updated by SSDN

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
</PRE>
This seems to be doing the trick, though I am sure to find that I have missed a couple of final details.&nbsp; It seems that the system relies on the <TT>/etc/hosts</TT> file for finding its domain name, though.&nbsp; I haven't found a way to make the system derive its domain name from the DNS system or anything as of yet, though that would really be nice on my little network.<BR>
<BR>
&nbsp;&nbsp;&nbsp; --- Mike<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Michael B. Trausch&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="mailto:mike@trausch.us">mike@trausch.us</A>
home: 404-592-5746, 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="http://www.trausch.us">www.trausch.us</A>
cell: 678-522-7934&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; im: <A HREF="mailto:mike@trausch.us">mike@trausch.us</A>, jabber
Ubuntu Unofficial Backports Project:&nbsp;&nbsp;&nbsp; <A HREF="http://backports.trausch.us/">http://backports.trausch.us/</A>

</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>