LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 01-21-2011, 02:22 AM   #1
oranix
LQ Newbie
 
Registered: Jan 2011
Posts: 1

Rep: Reputation: 0
Unhappy Can bind dlz work with the mysql stored procedure?


Hi,everyone, I have some trouble when I build a DNS server.
I need use mysql stored procedure work with the bind dlz mysql driver, but failed.
Can anyone give me some advice? Thanks very much.

dlz "Mysql zone" {
database "mysql
{host=127.0.0.1 dbname=dnsdata ssl=false}
{select domain from domains where domain='$zone$' LIMIT 1}
{call getrr('$zone$','SOME_ISP','$record$')}";

CREATE PROCEDURE `getrrr`(
IN inzone VARCHAR(255), IN inview VARCHAR(255),IN inrecord VARCHAR(255)
)
BEGIN
DECLARE lcount INT DEFAULT 0;
DECLARE dcount INT DEFAULT 0;
SELECT COUNT(*) INTO lcount FROM rr WHERE domain=inzone and view=inview and host=inrecord and active='Y';
SELECT COUNT(*) INTO dcount FROM rr WHERE domain=inzone and view like '%UNICOM' and host=inrecord and active='Y';

IF lcount != 0 THEN
SELECT ttl,type,mx_priority,data FROM rr WHERE domain=inzone and view=inview and active='Y' and host=inrecord;
ELSEIF dcount != 0 THEN
SELECT ttl,type,mx_priority,data FROM rr WHERE domain=inzone and view like '%UNICOM' and active='Y' and host=inrecord;
ELSE
SELECT ttl,type,mx_priority,data FROM rr WHERE domain=inzone and active='Y' and host=inrecord;
END IF;

select ttl,type,mx_priority,IF(type='SOA',concat_ws(' ',data,mbox,serial,refresh,retry,expire,minimum),data) from soa where domain=inzone;
END//

Last edited by oranix; 01-21-2011 at 02:24 AM.
 
Old 01-22-2011, 06:58 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
Would you please elaborate on what you mean by failed? What error messages are you getting, what is working and what is not working, etc.

Does your zone information work and get loaded properly by Bind when you don't try to configure it through MySQL? Do other zones work?

Have a look at this page. There are some particular warnings about using the DLZ driver with MySQL.
 
  


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
Problem creating Stored Procedure in MySQL Administrator andrewhiggs Linux - Software 1 07-23-2010 03:27 AM
Information about bind dlz‏ coffee777 Linux - Server 2 09-18-2009 01:01 AM
Run two instances of a dlz engine in BIND 9.5? fmillion Linux - Networking 3 06-14-2008 01:48 AM
MySQL Stored Procedure Question?? sehgals Linux - Software 5 01-31-2005 01:54 PM
stored procedure in mysql suchi_s Programming 2 10-01-2004 06:14 AM


All times are GMT -5. The time now is 11:24 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