LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-19-2013, 09:27 AM   #1
anindyameister
Member
 
Registered: Oct 2012
Posts: 40

Rep: Reputation: Disabled
BIND 9.9 DLZ with MySQL backend reverse lookup issue.


I'm trying to setup a BIND dns server with mysql backend database. I have compiled bind with mysql support and have installed a schema in the mysql database. Now I am able to do forward lookups of A records but I can't do a reverse lookup. I understand I have to write a new query for that, but i don't know which token to replace '$record$' with. Here is my dlz configuration

Code:
dlz "Mysql zone" {
   database "mysql
   {host=localhost  port=3306 dbname=BindDB user=Bind_User pass=Bind_User ssl=tRue}
   {SELECT zone FROM dns_records WHERE zone = '$zone$'}
   {SELECT ttl, type, mx_priority, IF(type = 'TXT', CONCAT('\"',data,'\"'), data) AS data
    FROM dns_records
    WHERE zone = '$zone$' AND host = '$record$' AND type <> 'SOA' AND type <> 'NS'}
   {SELECT ttl, type, data, primary_ns, resp_person, serial, refresh, retry, expire, minimum
    FROM dns_records
    WHERE zone = '$zone$' AND (type = 'SOA' OR type='NS')}
   {SELECT ttl, type, host, mx_priority, IF(type = 'TXT', CONCAT('\"',data,'\"'), data) AS data, resp_person, serial, refresh, retry, expire, minimum
    FROM dns_records
    WHERE zone = '$zone$' AND type <> 'SOA' AND type <> 'NS'}
   {SELECT zone FROM xfr_table where zone='$zone$' AND client = '$client$'}";
};

Also in the reply at the client side, the authority section is returning the IP address prefixed with the hostname. What might be the problem here ??


Code:
    ;; ANSWER SECTION:
    <Hostname> 180     IN      A      <IP>
    
    ;; AUTHORITY SECTION:
    <NS Hostname>.      180     IN      NS      <NS IP>.<NS Hostname>.
 
Old 09-20-2013, 02:21 AM   #2
anindyameister
Member
 
Registered: Oct 2012
Posts: 40

Original Poster
Rep: Reputation: Disabled
Okay I have fixed the authority section after correctly formatting the NS record in the database. But still no clue on how to do a reverse lookup.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Issue with Reverse Lookup on RHEL 5 when using BIND anandr4u Linux - Server 8 07-22-2013 08:15 PM
Bind reverse lookup mattyg007 Linux - Networking 1 12-08-2011 12:11 PM
Can bind dlz work with the mysql stored procedure? oranix Linux - Server 1 01-22-2011 06:58 AM
[SOLVED] bind reverse zone; no name with reverse lookup deadeyes Linux - Server 3 10-12-2009 09:54 AM
Bind reverse lookup Kostko Linux - Networking 2 12-07-2002 09:06 AM


All times are GMT -5. The time now is 01:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration