Modify dhcpd.conf to push hostnames to separate dns(s) servers



  • good day all…
    a brief description of what i have setup and what i'm trying to achieve...
    i currently have pfsense 2.03 configured as gateway(with 1:1nat)/firewall/dhcp/dns

    i have just recently setup two VM ubuntu12.04 with bind9 acting as registered nameservers at my registrar for use with virtualmin/webmin etc.etc...  everything works great in this area....

    next challenge remove DNS role from pfsense box...

    in the pfsense gui dhcp/lan tab i have configured the dns ip(s) for dhcp to assign out to clients so all clients now use the two ubuntu bind9 servers... working great...

    the next thing i would like to do is have pfsense's dchpd register hostnames to ubuntu bind9 nameserver directly...

    thus my goal is to use bind9 " $GENERATE 100-254 dhcp${-155,3} A 2*.*3.236.$ " to create a records for my clients thus their host names are resolvable with my domainname from net side....

    so i've been reading all over the place and have a idea what i could do but before i make changes to pfsense box /var/dhcpd/etc/dhcpd.conf
    i wanted to check here at pfsense forums for input from other user that might have tried something similar and/or experiences

    referenced from:
    http://www.freebsddiary.org/phorum/read.php?f=6&i=80&t=80
    http://linuxreviews.org/man/dhcpd.conf/
    http://ftp.isc.org/isc/bind9/cur/9.9/doc/arm/Bv9ARM.ch06.html#id2599174

    as example cutNpaste from a post from mentioned references above…

    -------------------------------------------------------
    option domain-name "dynamicdomain.";
    option domain-name-servers 192.168.1.1;
    
    default-lease-time 600;
    max-lease-time 7200;
    
    authoritative;
    
    ddns-updates on;
    ddns-update-style interim;
    ddns-domainname "dynamicdomain.";
    allow client-updates;
    
    subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.101 192.168.1.201;
    option routers 192.168.1.1;
    }
    
    key dynamickey {
    algorithm hmac-md5;
    secret <notshown>;
    }
    
    zone dynamiczone. {
    primary 192.168.1.1;
    key dynamickey;
    }
    
    zone 1.168.192.in-addr.arpa. {
    primary 192.168.1.1;
    key dynamickey;
    }</notshown>
    

    heres my current config for dhcpd.conf from /var/dhcpd/etc/

    option domain-name "mydomainname.com";
    option ldap-server code 95 = text;
    option domain-search-list code 119 = text;
    
    default-lease-time 7200;
    max-lease-time 86400;
    log-facility local7;
    ddns-update-style none;
    one-lease-per-client true;
    deny duplicates;
    ping-check true;
    authoritative;
    subnet 2*.*3.236.0 netmask 255.255.255.0 {
            pool {
                    option domain-name-servers 2*.*3.236.10,2*.*3.236.11;
                    range 2*.*3.236.100 2*.*3.236.254;
            }
            option routers 2*.*3.236.1;
            option domain-name "mydomainname.com";
            ddns-domainname "2*.*3.236.10";
            ddns-update-style interim;
            option domain-name-servers 2*.*3.236.10,2*.*3.236.11;
    
    

    would adding/changing these lines do what i'm looking for?:

    ddns-updates on;
    ddns-update-style interim;
    ddns-domainname "domainname.com";
    allow client-updates;
    
    key dynamickey {
    algorithm hmac-md5;
    secret <notshown>;
    }
    
    zone dynamiczone. {
    primary 2*.*3.236.10;
    key dynamickey;
    }
    
    zone 236.*3.2*.in-addr.arpa. {
    primary 2*.*3.236.10;
    key dynamickey;
    }</notshown>
    

    if so, the new dhcpd.conf should look like this?

    option domain-name "mydomainname.com";
    option ldap-server code 95 = text;
    option domain-search-list code 119 = text;
    
    default-lease-time 7200;
    max-lease-time 86400;
    log-facility local7;
    ddns-update-style none;
    one-lease-per-client true;
    deny duplicates;
    ping-check true;
    authoritative;
    subnet 2*.*3.236.0 netmask 255.255.255.0 {
            pool {
                    option domain-name-servers 2*.*3.236.10,2*.*3.236.11;
                    range 2*.*3.236.100 2*.*3.236.254;
            }
            option routers 2*.*3.236.1;
            option domain-name "mydomainname.com";
            ddns-updates on
            ddns-domainname "mydomainname.com";
            ddns-update-style interim;
            option domain-name-servers 2*.*3.236.10,2*.*3.236.11;
            allow client-updates;
    }
    key dynamickey {
    algorithm hmac-md5;
    secret <notshown>;
    }
    
    zone mydomainname.com. {
    primary 2*.*3.236.10;
    key dynamickey;
    }
    
    zone 236.*3.2*.in-addr.arpa. {
    primary 2*.*3.236.10;
    key dynamickey;
    }</notshown> 
    

    then config my ubuntu zones dynamickey accordingly….

    i know i'm a noob to this but trying my best to figure things out...

    any input is grateful....


  • Rebel Alliance Developer Netgate

    You can't hand edit the DHCP config there because the system will just overwrite it or remove it.

    The DDNS from DHCP feature was completely broken on 2.0.x and before (not sure for how long, but probably for years).

    It's fixed on 2.1 and you can just specify the DNS server for that in the DHCP settings for each tab individually to do what you want. I made a patch for 2.0.x that can also fix it, but using 2.1 is better as it has a more complete/proper fix.



  • thank you very much for the reply…

    i'll setup a new VM and start testing away...