opennetadmin / ona

OpenNetAdmin IP Address Management (IPAM) system
opennetadmin.com
GNU General Public License v2.0
136 stars 35 forks source link

PTR records not being found with BIND DLZ #87

Open mholttech opened 9 years ago

mholttech commented 9 years ago

I'm having an issue with PTR records not being found via the DLZ lookup. I switch to build_bind and the PTR works perfectly. Any ideas why this isn't working?

this is my DLZ configuration:

acl "private_hosts" {
    127.0.0.0/8;
    10.20.10.0/24;
    10.10.11.0/24;
    10.20.20.0/24;
    10.20.47.0/24;
    10.20.50.0/24;
    192.168.1.0/24;
    192.168.168.0/24;
    10.20.80.0/24;
    10.40.20.0/24;
    10.30.21.0/24;
    10.30.10.0/24;
    10.30.90.0/24;
};

view "private" {
    match-clients { any; };
    recursion yes;

    dlz "ONA Private Zone" {
        database "mysql
        {host=x.x.x.x dbname=ona_default user=ona_bind pass=xxxx}
        {select zone from dns_records where zone = '$zone$' and type = 'SOA' limit 1}
        {select ttl, type, mx_priority, data, resp_person, serial, refresh, retry, expire, minimum
            from dns_records where zone = '$zone$' and host = '$record$' and view in ('DEFAULT', 'ALL')}
        {}
        {select ttl, type, host, mx_priority, data, resp_person, serial, refresh, retry, expire, minimum
            from dns_records where zone = '$zone$' and view in ('DEFAULT', 'ALL')}
        {select zone from xfr_table where zone = '$zone$' and client = '$client$'}";
    };

    // rndc key
    include "/etc/bind/rndc.key";
};

options {
        directory "/var/cache/bind";

        recursion yes;
        allow-query { any; };

        forwarders {
                 8.8.8.8;
                8.8.4.4;
        };
        dnssec-validation auto;

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};
fxpottier commented 9 years ago

Hi,

What your bind say in its logs when querying PTR records ? I assume the PTR zone exists and the bind server is master or at least forwarder for it. Le 22 mai 2015 19:59, "mholtrlc" notifications@github.com a écrit :

I'm having an issue with PTR records not being found via the DLZ lookup. I switch to build_bind and the PTR works perfectly. Any ideas why this isn't working?

this is my DLZ configuration:

acl "private_hosts" { 127.0.0.0/8; 10.20.10.0/24; 10.10.11.0/24; 10.20.20.0/24; 10.20.47.0/24; 10.20.50.0/24; 192.168.1.0/24; 192.168.168.0/24; 10.20.80.0/24; 10.40.20.0/24; 10.30.21.0/24; 10.30.10.0/24; 10.30.90.0/24; };

view "private" { match-clients { any; }; recursion yes;

dlz "ONA Private Zone" {
    database "mysql
    {host=x.x.x.x dbname=ona_default user=ona_bind pass=xxxx}
    {select zone from dns_records where zone = '$zone$' and type = 'SOA' limit 1}
    {select ttl, type, mx_priority, data, resp_person, serial, refresh, retry, expire, minimum
        from dns_records where zone = '$zone$' and host = '$record$' and view in ('DEFAULT', 'ALL')}
    {}
    {select ttl, type, host, mx_priority, data, resp_person, serial, refresh, retry, expire, minimum
        from dns_records where zone = '$zone$' and view in ('DEFAULT', 'ALL')}
    {select zone from xfr_table where zone = '$zone$' and client = '$client$'}";
};

// rndc key
include "/etc/bind/rndc.key";

};

options { directory "/var/cache/bind";

    recursion yes;
    allow-query { any; };

    forwarders {
             8.8.8.8;
            8.8.4.4;
    };
    dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };

};

— Reply to this email directly or view it on GitHub https://github.com/opennetadmin/ona/issues/87.