Looking for a pointer on getting reverse mapping with DDNS to work with DHCPD & Named.

Jim Bucks jbucks at coloradostudios.com
Thu Mar 28 20:26:35 UTC 2013


Hi Jim,

Shouldn't there be quotes around the key string in the named .conf file?  I
have quotes around mine in named.conf.  I do not have quotes around the key
string in the dhcpd.conf.

If this is correct, I've made sure they match (I was trying to "genericize"
the key string before), but not any longer.

After making sure the key strings match, I'm still getting the error
"unable to add forward map" when I do a release & renew from a windows
laptop.
Here are the current (and live) config files.

named.conf
=====================
/*
 Sample named.conf BIND DNS server 'named' configuration file
 for the Red Hat BIND distribution.

 See the BIND Administrator's Reference Manual (ARM) for details, in:
   file:///usr/share/doc/bind-{
version}/arm/Bv9ARM.html
 Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
 its manual.
*/

acl stapleton_hosts {
    127.0.0.1;
    172.10.0.0/16;
};

options
{
    // Put files that named is allowed to write in the data/ directory:
    directory         "/var/named";        // "Working" directory
    dump-file         "data/cache_dump.db";
        statistics-file     "data/named_stats.txt";
        memstatistics-file     "data/named_mem_stats.txt";
        zone-statistics         yes;


    /*
      Specify listenning interfaces. You can use list of addresses (';' is
      delimiter) or keywords "any"/"none"
    */
    //listen-on port 53    { any; };
    listen-on port 53    { 127.0.0.1; 172.10.0.0; };

    //listen-on-v6 port 53    { any; };
    //listen-on-v6 port 53    { ::1; };

    /*
      Access restrictions

      There are two important options:
        allow-query { argument; };
          - allow queries for authoritative data

        allow-query-cache { argument; };
          - allow queries for non-authoritative data (mostly cached data)

      You can use address, network address or keywords
"any"/"localhost"/"none" as argument
      Examples:
        allow-query { localhost; 10.0.0.1; 192.168.1.0/8; };
        allow-query-cache { ::1; fe80::5c63:a8ff:fe2f:4526; 10.0.0.1; };
    */

    allow-query        { stapleton_hosts; };
    allow-query-cache    { stapleton_hosts; };

    // Enable/disable recursion - recursion yes/no;
    recursion yes;

    /* DNSSEC related options. See information about keys ("Trusted keys",
bellow) */

    /* Enable serving of DNSSEC related data - enable on both authoritative
        and recursive servers DNSSEC aware servers */
    //dnssec-enable yes;

    /* Enable DNSSEC validation on recursive servers */
    //dnssec-validation yes;

    /* Enable DLV by default, use built-in ISC DLV key. */
    //dnssec-lookaside auto;

        version "Secret";

};

# Use this command line to generate the key.  Only need the key string
(from the .private file) inside these files.
#      dnssec-keygen -a HMAC-MD5 -b 512 -n USER DHCP_UPDATER
#
# It is very important to use the exact same keystring and name on both
dhcpd.conf and named.conf for this to work.
key DHCP_UPDATER {                       # This line specifies the key name
    algorithm HMAC-MD5;                  # This line specifies the
encryption algorithm best to stick with HMAC-MD5
    secret
"TrlaHSJXel+L5hqtfev5Gdlwj7B+HqcXQiqXMdZ/8mGXhznkRXf6yMDaQ9rXbx45gFgVpW7PFRHXGsZfUKrFlw==";
# Finally, the key statement itself
};


logging
{
/*      If you want to enable debugging, eg. using the 'rndc trace' command,
 *      named will try to write the 'named.run' file in the $directory
(/var/named).
 *      By default, SELinux policy does not allow named to modify the
/var/named directory,
 *      so put the default debug log file in data/ :
 */
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

/*
 Views let a name server answer a DNS query differently depending on who is
asking.

 By default, if named.conf contains no "view" clauses, all zones are in the
 "default" view, which matches all clients.

 Views are processed sequentially. The first match is used so the last view
should
 match "any" - it's fallback and the most restricted view.

 If named.conf contains any "view" clause, then all zones MUST be in a view.
*/

//view "localhost_resolver"
//{
///* This view sets up named to be a localhost resolver ( caching only
nameserver ).
// * If all you want is a caching-only nameserver, then you need only
define this view:
// */
//    match-clients         { localhost; };
//    recursion yes;
//
//    # all views must contain the root hints zone:
//    zone "." IN {
//            type hint;
//            file "/var/named/named.ca";
//    };
//
//       /* these are zones that contain definitions for all the localhost
//         * names and addresses, as recommended in RFC1912 - these names
should
//     * not leak to the other nameservers:
//     */
//    include "/etc/named.rfc1912.zones";
//};
view "internal"
{
/* This view will contain zones you want to serve only to "internal" clients
   that connect via your directly attached LAN interfaces - "localnets" .
 */
    match-clients        { stapleton_hosts; };
    recursion yes;

        disable-empty-zone ".";

        allow-update            { stapleton_hosts; };

    zone "." IN {
            type hint;
            file "internal/root.hints";
    };

        /* these are zones that contain definitions for all the localhost
         * names and addresses, as recommended in RFC1912 - these names
should
     * not leak to the other nameservers:
     */
    include "internal/named.rfc1912.zones";

    // These are your "authoritative" internal zones, and would probably
    // also be included in the "localhost_resolver" view above :

    /*
      NOTE for dynamic DNS zones and secondary zones:

      DO NOT USE SAME FILES IN MULTIPLE VIEWS!

      If you are using views and DDNS/secondary zones it is strongly
      recommended to read FAQ on ISC site (www.isc.org), section
      "Configuration and Setup Questions", questions
      "How do I share a dynamic zone between multiple views?" and
      "How can I make a server a slave for both an internal and an external
       view at the same time?"
    */

       /*
         Based on research, need to put DDNS "zones" files into the
/var/named/chroot/var/named/slaves/ directory.
         Named has a "bug" that prevents them from being updated in the
usual place /var/named/chroot/var/named/internal/
       */
        // forward "zones" file.
    zone "dhcp.coloradostudios.com" {
        type master;
        allow-update { key DHCP_UPDATER; };
        file "slaves/db.dhcp.coloradostudios.com";
                notify yes;
        // put dynamically updateable zones in the slaves/ directory so
named can update them
    };

        // Reverse "zones" file.
        zone "20.10.172.in-addr.arpa" {
                type master;
                allow-update { key DHCP_UPDATER; };
                file "slaves/db.172.10.20";
                notify yes;
        };
};

//key ddns_key
//{
//    algorithm hmac-md5;
//    secret "use /usr/sbin/dnssec-keygen to generate TSIG keys";
//};

//view "external"
//{
///* This view will contain zones you want to serve only to "external"
clients
// * that have addresses that are not match any above view:
// */
//    match-clients        { any; };
//
//    zone "." IN {
//            type hint;
//            file "/var/named/named.ca";
//    };
//
//    recursion no;
//    // you'd probably want to deny recursion to external clients, so you
don't
//        // end up providing free DNS service to all takers
//
//    // These are your "authoritative" external zones, and would probably
//        // contain entries for just your web and mail servers:
//
//    zone "my.external.zone" {
//        type master;
//        file "my.external.zone.db";
//    };
//};


dhcpd.conf
====================================
#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see 'man 5 dhcpd.conf'
#
# Sept 19, 2012      jbucks
#  /etc/dhcp/dhcdp.conf file - prepping for dhcp rollout
#
#
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".>
INTERFACES="eth1";

deny client-updates;              # Tells the server to deny any requests
that clients may send to update their own information.

authoritative;                    # Sets the server authoritative for my
network
ddns-update-style interim;        # Activates Dynamic DNS
max-lease-time 604800;            # 604800 is a week
default-lease-time 86400;         # 86400 is a day

# Use this command line to generate the key.  Only need the key string
(from the .private file) inside these files.
#       dnssec-keygen -a HMAC-MD5 -b 512 -n USER DHCP_UPDATER
#
#  It is very important to use the exact same keystring and name on both
dhcpd.conf and named.conf for this to work.
key DHCP_UPDATER {                       # This line specifies the key name
    algorithm HMAC-MD5;                  # This line specifies the
encryption algorithm best to stick with HMAC-MD5
    secret
TrlaHSJXel+L5hqtfev5Gdlwj7B+HqcXQiqXMdZ/8mGXhznkRXf6yMDaQ9rXbx45gFgVpW7PFRHXGsZfUKrFlw==;
# Finally the key statement itself
};


# These zones statements are part of the dynamic dns (named) as they link
back into the bind (named) zones
zone dhcp.coloradostudios.com. {
   primary 127.0.0.1;
   key DHCP_UPDATER;
}

zone 20.10.172.in-addr.arpa. {
   primary 127.0.0.1;
   key DHCP_UPDATER;
}

subnet 172.10.0.0 netmask 255.255.0.0 {
   option broadcast-address 172.10.255.255;
   option domain-name       "coloradostudios.com";
   option routers           172.10.5.1;
   ddns-hostname = concat ("dhcp-", binary-to-ascii (10, 8, "-",
leased-address));
   option time-offset       -7;     # Mountain Standard Time
   range                    172.10.20.51 172.10.20.254;
}




On Thu, Mar 28, 2013 at 2:00 PM, Jim Glassford <jmglass at iup.edu> wrote:

>  Hi Jim,
>
> Looking at your config files, believe the keys do not match in named.conf
> and dhcpd.conf but maybe they were adjusted for the posting to the list.
> Alan Clegg's link shows creating the key and adding it to the files and
> also some nsupdate examples.
>
>
> Would want like the following, only with your key in each file, cut and
> paste that key! :-)
>
> ~~~ inside dhcpd.conf this ~~~~~
>
> key DHCP_UPDATER {
>     algorithm HMAC-MD5;
>     secret xxxxxxxxxxxxxxxxxxxxxxxx;
> };
>
>  ~~~ inside named.conf this ~~~~~
>
> key DHCP_UPDATER {
>     algorithm HMAC-MD5;
>     secret xxxxxxxxxxxxxxxxxxxxxxxx;
> };
>
>
> On 3/28/2013 3:05 PM, Jim Bucks wrote:
>
> Hi All (sorry for the top-posting)....
>
> Alan - thanks for the link.  I'll be checking it out / looking it over.
>
> Jim,
>
> Based on the nsupdate output (below), it looks like I've hosed up
> something in my "key".  I used the key string from the .private key file
> (I've found some search results that say to use the .key and others say to
> use the .private).
>
> Jim
>
> [root at dns04 chroot]# nsupdate -d
> > server 127.0.0.1
> > key DHCP_UPDATE
> TrlaHSJXel+L5hqtfev5Gdlwj7B+HqcXQiqXMdZ/8mGXhznkRXf6yMDaQ9rXbx45gFgVpW7PFRHXGsZfUKrFlw==
> > update add 101.20.10.172.in-addr.arpa. 3600 in ptr
> dhcp.coloradostudios.com.
>
> >
> Reply from SOA query:
> ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id:  11212
> ;; flags: qr aa ra; QUESTION: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0
> ;; QUESTION SECTION:
> ;101.20.10.172.in-addr.arpa.    IN    SOA
>
> ;; AUTHORITY SECTION:
> 20.10.172.in-addr.arpa.    0    IN    SOA    dns04.coloradostudios.com.
> sysmgr.hd.net. 2013032600 10800 3600 604800 86400
>
> Found zone name: 20.10.172.in-addr.arpa
> The master is: dns04.coloradostudios.com
> Sending update to 127.0.0.1#53
> Outgoing update query:
> ;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id:  25308
> ;; flags:; ZONE: 1, PREREQ: 0, UPDATE: 1, ADDITIONAL: 1
> ;; UPDATE SECTION:
> 101.20.10.172.in-addr.arpa. 3600 IN    PTR    dhcp.coloradostudios.com.
>
> ;; TSIG PSEUDOSECTION:
> dhcp_update.        0    ANY    TSIG    hmac-md5.sig-alg.reg.int.
> 1364496936 300 16 qUBZdqVmksNQtmb1mb9gNQ== 25308 NOERROR 0
>
> ; TSIG error with server: tsig indicates error
>
> Reply from update query:
> ;; ->>HEADER<<- opcode: UPDATE, status: NOTAUTH, id:  25308
> ;; flags: qr ra; ZONE: 1, PREREQ: 0, UPDATE: 0, ADDITIONAL: 1
> ;; ZONE SECTION:
> ;20.10.172.in-addr.arpa.        IN    SOA
>
> ;; TSIG PSEUDOSECTION:
> dhcp_update.        0    ANY    TSIG    hmac-md5.sig-alg.reg.int.
> 1364496936 300 0  25308 BADKEY 0
>
> > quit
> [root at dns04 chroot]#
>
>
> On Thu, Mar 28, 2013 at 12:03 PM, Jim Glassford <jmglass at iup.edu> wrote:
>
>>  Hi Jim,
>>
>> No, sorry, wrong IP address, the real IP address of the dns server, not
>> the client.
>>
>> zone dhcp.coloradostudios.com. {
>>    primary your_dns_server_IP_address;                         <-----
>> change from 127.0.0.1
>>    key DHCP_UPDATER;
>> }
>>
>> Also do you have a /var/log/named.log file or debug log file for named,
>> other than messages, might have more information.
>> Can try nsupdate with debug to see if this gives any clue also.
>> nsupdate -d
>> > server your_dns_server_here
>> > key  your_key_here
>> > update add 101.20.10.172.in-addr.arpa. 3600 in ptr
>> dhcp-172-10-20-101.coloradostudios.com.
>> >  do extra CR to get it to go
>>
>> should see lots of debug information here
>> >
>> > quit
>>
>> man nsupdate
>>
>> best!
>> jim
>>
>> On 3/28/2013 1:52 PM, Jim Bucks wrote:
>>
>> No I have not tried that, but .101 is a leased IP address for a Windows
>> workstation.
>>
>> I'm willing to try it, but it seems like that would mean I would need a
>> zone like this for all of my leased addresses???
>>
>>
>> Jim
>>
>> On Thu, Mar 28, 2013 at 11:42 AM, Jim Glassford <jmglass at iup.edu> wrote:
>>
>>>  Hi Jim,
>>>
>>> Lost track but have you tried using the IP address of the server for the
>>> primary, 172.10.20.101 instead of 127.0.0.1?
>>>
>>> zone dhcp.coloradostudios.com. {
>>>    primary 172.10.20.101;                         <----- change from
>>> 127.0.0.1
>>>    key DHCP_UPDATER;
>>> }
>>>
>>>
>>> best!
>>> jim
>>>
>>>
>>>
-- 
Jim Bucks - IT Director
Colorado Studios <http://www.coloradostudios.com>, Mobile TV
Group<http://www.mobiletvgroup.com>,
HDNet <http://www.hd.net>, AXS.tv <http://www.axs.tv/>
8269 E. 23rd Ave. Denver, CO 80238 Main  303-388-8500
jbucks at coloradostudios.com            Direct 303-542-5520
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/bind-users/attachments/20130328/e712ebd5/attachment.html>


More information about the bind-users mailing list