Re: Order of Operations issue.

Rob Butler <[email protected]>
Newsgroups gmane.network.dns.bind9.dlz
Message-ID <[email protected]>
Your SQL queries probably aren't returning the results you expect.  Thus, DLZ says its not authoratative and the query falls through to the cache and recursively resolves the request.

Run bind in the foreground and turn debugging up so you see the exact SQL being sent in your queries.  Then copy and paste that SQL into your favorite SQL query tool.  It is VERY important you copy and paste the query, if you retype it you'll change it and violate the results.  It could be something as simple as case-sensitivity in your DB..

I think DLZ lower cases all names before searching in the DB.  If your DB is setup to be case sensitive and has upper, or mixed case zone names then things won't match, and you get no results back.

Rob

----- Original Message ----
From: Michael J. Ayers <[email protected]>
To: bind-dlz-testers <[email protected]>
Sent: Wednesday, April 9, 2008 12:21:03 PM
Subject: [Bind-dlz-testers] Order of Operations issue.

I am trying to get a DNS server here answering queries for our domain, but it is not working in the way I was hoping.  I have set up the server to answer for our domain as if it is the Authoritative DNS server.  Unfortunately, it seems that whenever I do a lookup against it, the server goes out to the root servers, finds the ACTUAL authoritative server for the domain, then retrieves information from that server.  I want it to not do that so that I can test that my database is working properly and that the server is querying it.  Any ideas?  I have attached my named.conf below.  It seems it is not even trying to query the database from what I can see in the debug log I created.


acl "all" { 0.0.0.0/0; };
options {
        directory "/var/named";
        /* forward first; */
        /* forwarders { */
        /*      4.2.2.1; */
        /*      4.2.2.4; */
        /* }; */
        allow-query { "all"; };
};

logging {
        channel test.debug {
                file "/tmp/satest.debug.log";
                severity debug;
                print-time yes;
                print-severity yes;
                print-category yes;
        };
        category "default" { test.debug; };
        category "security" { test.debug; };
        category "config" { test.debug; };
        category "queries" { test.debug; };
        category "parser" { test.debug; };
        category "eventlib" { test.debug; };
};

view "internal" {
        match-clients { localnets; 10.0.0.0/8; };

        zone "." {
                type hint;
                file "root.hints";
        };

        dlz "Mysql zone" {
                database "mysql
                {host=localhost dbname=dns_internal user=dns pass=password}
                {select zone from records where zone = '%zone%'}
                {select ttl, type, mx_priority, case when lower(type)='txt' then concat('\"', data, '\"') when lower(type) = 'soa' 
                  then concat_ws(' ', data, resp_person, serial, refresh, retry, expire, minimum) else data end from records 
                  where zone = '%zone%' and host = '%record%'}
                {}
                {select ttl, type, host, mx_priority, case when lower(type)='txt' then
                  concat('\"', data, '\"') else data end, resp_person, serial, refresh, retry, expire,
                  minimum from records where zone = '%zone%'}
                {select zone from xfr where zone = '%zone%' and client = '%client%'}";
        };
};

view "external" {
        match-clients { any; };

        zone "." {
             type hint;
             file "root.hints";
        };

        dlz "Mysql zone" {
                database "mysql
                {host=localhost dbname=dns_external user=dns pass=password}
                {select zone from records where zone = '%zone%'}
                {select ttl, type, mx_priority, case when lower(type)='txt' then concat('\"', data, '\"') when lower(type) = 'soa' 
                  then concat_ws(' ', data, resp_person, serial, refresh, retry, expire, minimum) else data end from records 
                  where zone = '%zone%' and host = '%record%'}
                {}
                {select ttl, type, host, mx_priority, case when lower(type)='txt' then
                  concat('\"', data, '\"') else data end, resp_person, serial, refresh, retry, expire,
                  minimum from records where zone = '%zone%'}
                {select zone from xfr where zone = '%zone%' and client = '%client%'}";
        };
};

Thanks for any and all help.


-- 
Michael J. Ayers
Senior Systems Engineer 




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

_______________________________________________
Bind-dlz-testers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.