# This file contributed by Chris Cox (cjcox@acm.org).
# 
# This file shows only DDNS-related stuff, it is not a complete config file!

# This prevents clients from updating their own information, we
# will instead parse the client supplied options and make
# the selection of hostname and domainname.
deny client-updates;

# This forces the domain name here If you want different domain names for
# different clients, you can override this name in a more specific
# scope - at group, subnet, pool or even host level.
ddns-domainname "my.domain";

# DDNS is still in flux, hence the term "interim". If you are using DDNS,
# this line has to be here.
ddns-update-style interim;

# This allows there to be entries in the leases file and ddns updates
# made for fixed addresses.
update-static-leases true;

# Generate DNS names for clients who don't provide a
# host-name... the generated names will be ASCII representations
# of the clients' MAC addresses.  See notes below on variations for
# fixed-address hosts.
ddns-hostname = pick (option fqdn.hostname, option host-name,
        binary-to-ascii (16, 8, "-", substring (hardware, 1, 6)));

# Describe forward DNS zones allowing updates
#
# CHANGE the key and you'll need to change the key in
# BIND and remove all DNS dynamic journals (.jnl) and
# clear out the dhcpd.leases.
#
# This key must match the key in your BIND named.conf
# for updates to the zones.
#
# DON'T CHANGE this often!
#
key DHCP_UPDATE {
        algorithm hmac-md5;
        secret "your-secret-goes-here!!";
}

zone my.domain.com. {
        # I'm assuming the BIND 9.1/9.2 is on the same localhost.
        primary 127.0.0.1;
        key DHCP_UPDATE;
}

# Describe reverse DNS zones allowing updates
zone 30.20.10.in-addr.arpa. {
        primary 127.0.0.1;
        key DHCP_UPDATE;
}

# This is a subnet showing what's needed to get DDNS happening for clients
# in the subnet. Note the keyword "dynamic" on the fixed addresses, so that
# they get entries in the leases file and ddns entries.
subnet 10.20.30.0 netmask 255.255.255.0
{
   option routers 10.20.30.1 ;

   pool 
   {
      failover peer "dhcp" ;
      deny dynamic bootp clients ;
      range 10.20.30.217 10.20.30.219 ;
   }


   host myhost-1
   {
      # This host will get the specific name "sample-name-1", rather than a
      # generated name. The name requested by the client will be ignored.
      ddns-hostname "sample-name-1";
      dynamic;
      hardware ethernet 00:E0:B8:15:B9:72 ;
      fixed-address 10.20.30.120 ;
   }

   host myhost-2
   {
      # This host will get a generated default hostname, because we haven't
      # specified any name. It also gets registered in the domain
      # "other.domain", overriding the globally configured "my.domain".
      dynamic;
      ddns-domainname "other.domain";
      hardware ethernet 00:04:76:90:38:3D ;
      fixed-address 10.20.30.121 ;
   }
}


