Re: Contents of Bind-dlz-testers digest, Vol 1 #83 - 3 msgs
Nick R. <nickr <at> fcc.net>
2003-06-19 12:47:43 GMT
If you look below this is what is working for me. i have more work to do on
it make it faster....
On flat file and using a different mysql dbase driver nslokups are 0.007-9
on this one it is 0.169 is the lowest ive gotten it, anyone else have times?
Nick R.
----- Original Message -----
From: <bind-dlz-testers-request <at> lists.sourceforge.net>
To: <bind-dlz-testers <at> lists.sourceforge.net>
Sent: Wednesday, June 18, 2003 11:05 PM
Subject: Bind-dlz-testers digest, Vol 1 #83 - 3 msgs
> Send Bind-dlz-testers mailing list submissions to
> bind-dlz-testers <at> lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
> or, via email, send a message with subject or body 'help' to
> bind-dlz-testers-request <at> lists.sourceforge.net
>
> You can reach the person managing the list at
> bind-dlz-testers-admin <at> lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Bind-dlz-testers digest..."
>
>
> Today's Topics:
>
> 1. Database problems (bad schema?) (Svensson, Martin)
> 2. Re: Contents of Bind-dlz-testers digest, Vol 1 #82 - 1 msg (Nick R.)
> 3. Re: Database problems (bad schema?) (Rob Butler)
>
> --__--__--
>
> Message: 1
> From: "Svensson, Martin" <martin.svensson <at> eds.com>
> To: "'bind-dlz-testers <at> lists.sourceforge.net'"
> <bind-dlz-testers <at> lists.sourceforge.net>
> Date: Wed, 18 Jun 2003 10:45:40 +0200
> Subject: [Bind-dlz-testers] Database problems (bad schema?)
> Reply-To: bind-dlz-testers <at> lists.sourceforge.net
>
> Hi all,
>
> I am trying to get DLZ to work with a schema that I found in the mailing
> list archives. I chose this schema because it puts zone info in one table
> and the records in another table and not everything in just one big table.
> My intention is to use Mysql as database.
>
> The problem I have is that I can't get SOA Answers! If anyone has the
> slightest idea please let me know.
> If you have another schema that works well and is scalable please let me
> know.
>
> The DB / Named.conf is as follows:
>
> # Table structure for table 'zone'
> CREATE TABLE zone (
> id int(11) unsigned NOT NULL auto_increment,
> ttl int(11) unsigned NOT NULL default '86400',
> zone varchar(255) NOT NULL default '',
> client varchar(15) default NULL,
> resp_person varchar(255) default 'hostmaster',
> serial int(11) unsigned NOT NULL default '1',
> refresh int(11) unsigned NOT NULL default '86400',
> retry int(11) unsigned NOT NULL default '7200',
> expire int(11) unsigned NOT NULL default '604800',
> minimum int(11) unsigned NOT NULL default '86400',
> PRIMARY KEY (id),
> KEY zona (zone,client)
> ) TYPE=MyISAM;
>
> # Table structure for table 'dns_records'
> CREATE TABLE dns_records (
> zone_id int(11) unsigned NOT NULL default '0',
> type enum('SOA','NS','MX','A','CNAME','TXT','HINFO','PTR') NOT NULL
> default 'SOA',
> host varchar(255) default NULL,
> mx_priority int(3) unsigned default NULL,
> data varchar(255) default NULL,
> KEY zh (zone_id,host)
> ) TYPE=MyISAM;
>
> dlz "Mysql zone" {
> database "mysql
> {host=localhost user=******* pass=****** dbname=dns_data ssl=false}
> {select id from zone 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
> zone,dns_records where id=zone_id and zone = '%zone%' and host =
> '%record%'}
> {}
> {select ttl, type, host, 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
> zone,dns_records where id=zone_id and zone = '%zone%'}
> {select id from zone where zone = '%zone%' and client='%client%'}
> {}";
> };
>
> mysql> select * from zone;
>
+----+-------+-------------+--------+-------------+--------+---------+------
> -+--------+---------+
> | id | ttl | zone | client | resp_person | serial | refresh | retry |
expire
> | minimum |
>
+----+-------+-------------+--------+-------------+--------+---------+------
> -+--------+---------+
> | 1 | 86400 | example.com | NULL | hostmaster2 |1 | 86400 | 7200 | 604800
|
> 86400 |
>
+----+-------+-------------+--------+-------------+--------+---------+------
> -+--------+---------+
>
>
> mysql> select * from dns_records;
> +---------+------+-------------+-------------+------------+
> | zone_id | type | host | mx_priority | data |
> +---------+------+-------------+-------------+------------+
> | 1 | SOA | example.com | NULL |myip.hu. |
> | 1 | NS | <at> | NULL | ns1 |
> | 1 | A | ns1 | NULL |127.0.0.1 |
> | 1 | A | www | NULL |10.10.10.1 |
> +---------+------+-------------+-------------+------------+
>
> Thanks in advance all!
>
> Best regards,
> Martin Svensson
>
>
> --__--__--
>
> Message: 2
> From: "Nick R." <nickr <at> fcc.net>
> To: <bind-dlz-testers <at> lists.sourceforge.net>
> Date: Wed, 18 Jun 2003 10:56:27 -0400
> Subject: [Bind-dlz-testers] Re: Contents of Bind-dlz-testers digest, Vol 1
#82 - 1 msg
> Reply-To: bind-dlz-testers <at> lists.sourceforge.net
>
> This is what I have and im having some speed issues, the indexes help a
bit,
> but when I have 4980+- domains and 1000's of queries it doesn't work too
> well.
>
> A small dump and the select scripts I have in my named.conf...
>
> with all my domains about 4980+- my typical nslookup is aprox. 0.167, when
I
> load test it once I reach a few hundred in the same second goes to 10
> seconds, and stops resolving. I think the database is a good idea but I
> believe a certain amount of memory caching should be used. I have a plan
im
> going to try which hopefully will work and I will pass this to the
> developers of DLZ.'
>
> Bind 9.2.2 mysql 4.0.13
> test Box is
> dual Pentium 3 500's
> 512M memory
>
> Production is
> Quad xeon 500's
> 2Gigs Memory
>
> Nick R.
>
> CREATE DATABASE /*!32312 IF NOT EXISTS*/ dns_data;
>
> USE dns_data;
>
> --
> -- Table structure for table 'data_count'
> --
>
> CREATE TABLE data_count (
> zone varchar(50) default NULL,
> count varchar(50) default NULL,
> KEY zone2 (zone(27))
> ) TYPE=MyISAM;
>
> --
> -- Dumping data for table 'data_count'
> --
>
> INSERT INTO data_count VALUES ('assassin.org','');
>
> --
> -- Table structure for table 'dns_records'
> --
>
> CREATE TABLE dns_records (
> id int(10) default NULL,
> ttl int(6) NOT NULL default '3600',
> type varchar(6) NOT NULL default '',
> host varchar(75) default NULL,
> zone varchar(50) default NULL,
> mx_priority int(4) default NULL,
> data varchar(50) default NULL,
> KEY id1 (id,ttl,type,mx_priority,data,zone(20))
> ) TYPE=MyISAM;
>
> --
> -- Dumping data for table 'dns_records'
> --
>
> INSERT INTO dns_records VALUES
> (1,3600,'A','www','assassin.org',NULL,'207.198.203.138');
> INSERT INTO dns_records VALUES
> (1,3600,'CNAME','webmail','assassin.org',NULL,'webmail.fronthost.com');
> INSERT INTO dns_records VALUES
> (1,1,'A','test2','assassin.org',NULL,'63.250.7.50');
> INSERT INTO dns_records VALUES
> (1,3600,'CNAME','smtp','assassin.org',NULL,'mail.assassin.org');
> INSERT INTO dns_records VALUES
> (1,3600,'A','pop','assassin.org',NULL,'63.250.6.251');
> INSERT INTO dns_records VALUES
> (1,1,'A','mail2','assassin.org',NULL,'24.161.2.231');
> INSERT INTO dns_records VALUES
> (1,3600,'A','mail','assassin.org',NULL,'63.250.6.251');
> INSERT INTO dns_records VALUES
> (1,1,'A','ibmclone','assassin.org',NULL,'68.44.202.195');
> INSERT INTO dns_records VALUES
> (1,3600,'A','dyndns','assassin.org',NULL,'63.250.60.4');
> INSERT INTO dns_records VALUES
> (1,3600,'A','*','assassin.org',NULL,'24.161.2.231');
> INSERT INTO dns_records VALUES
> (1,3600,'A',' <at> ','assassin.org',NULL,'207.198.203.138');
> INSERT INTO dns_records VALUES
> (1,600,'MX',' <at> ','assassin.org',10,'assassin.org.mail5.psmtp.com.');
> INSERT INTO dns_records VALUES
> (1,600,'MX',' <at> ','assassin.org',20,'assassin.org.mail6.psmtp.com.');
> INSERT INTO dns_records VALUES
> (1,600,'MX',' <at> ','assassin.org',30,'assassin.org.mail7.psmtp.com.');
> INSERT INTO dns_records VALUES
> (1,600,'MX',' <at> ','assassin.org',40,'assassin.org.mail8.psmtp.com.');
>
> --
> -- Table structure for table 'domains'
> --
>
> CREATE TABLE domains (
> id int(10) NOT NULL auto_increment,
> zone varchar(50) NOT NULL default '',
> PRIMARY KEY (id,zone)
> ) TYPE=MyISAM;
>
> --
> -- Dumping data for table 'domains'
> --
>
> INSERT INTO domains VALUES (4878,'assassin.org');
>
> --
> -- Table structure for table 'soa'
> --
>
> CREATE TABLE soa (
> id int(10) default NULL,
> zone varchar(50) default NULL,
> ttl int(6) default NULL,
> type varchar(6) default NULL,
> data varchar(50) default NULL,
> resp_person varchar(10) default NULL,
> serial int(6) default NULL,
> refresh int(6) default NULL,
> retry int(6) default NULL,
> expire int(6) default NULL,
> minimum int(6) default NULL,
> KEY id4
>
(id,ttl,type,zone(20),data,resp_person,serial,refresh,retry,expire,minimum)
> ) TYPE=MyISAM;
>
> --
> -- Dumping data for table 'soa'
> --
>
> INSERT INTO soa VALUES
> (1,'assassin.org',3600,'NS','ns3.fcc.net.',NULL,NULL,NULL,NULL,NULL,NULL);
> INSERT INTO soa VALUES
> (1,'assassin.org',3600,'NS','ns2.fcc.net.',NULL,NULL,NULL,NULL,NULL,NULL);
> INSERT INTO soa VALUES
> (1,'assassin.org',3600,'NS','ns1.fcc.net.',NULL,NULL,NULL,NULL,NULL,NULL);
> INSERT INTO soa VALUES
>
(1,'assassin.org',3600,'SOA','assassin.org','hostmaster',2003061801,3600,180
> 0,604800,3600);
>
> --
> -- Table structure for table 'xfr_table'
> --
>
> CREATE TABLE xfr_table (
> zone varchar(30) default NULL,
> client varchar(30) default NULL,
> KEY zone1 (zone(27))
> ) TYPE=MyISAM;
>
> --
> -- Dumping data for table 'xfr_table'
> --
>
> INSERT INTO xfr_table VALUES ('assassin.org','127.0.0.1');
> INSERT INTO xfr_table VALUES ('assassin.org','63.250.9.50');
> INSERT INTO xfr_table VALUES ('assassin.org','66.59.64.50');
>
> dlz "Mysql zone" {
> database "mysql
> {host=localhost dbname=dns_data user=xxxx pass=xxxxxx}
> {select id from domains where zone = '%zone%'}
> {select ttl, type, mx_priority, data from domains,dns_records
where
> domains.id=dns_records.id and domains.zone = '%zone%' and host =
'%record%'}
> {select ttl, type, data, resp_person, serial, refresh, retry,
> expire, minimum from soa,domains where domains.id=soa.id and domains.zone
=
> '%zone%'}
> {select ttl, type, host, mx_priority, data, resp_person from
> domains,dns_records where domains.id=dns_records.id and domains.zone =
> '%zone%'}
> {select zone from xfr_table where zone = '%zone%' and client =
> '%client%'}
> {update data_count set count = count + 1 where zone ='%zone%'}";
> };
> ----- Original Message -----
> From: <bind-dlz-testers-request <at> lists.sourceforge.net>
> To: <bind-dlz-testers <at> lists.sourceforge.net>
> Sent: Tuesday, June 17, 2003 11:02 PM
> Subject: Bind-dlz-testers digest, Vol 1 #82 - 1 msg
>
>
> > Send Bind-dlz-testers mailing list submissions to
> > bind-dlz-testers <at> lists.sourceforge.net
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
> > or, via email, send a message with subject or body 'help' to
> > bind-dlz-testers-request <at> lists.sourceforge.net
> >
> > You can reach the person managing the list at
> > bind-dlz-testers-admin <at> lists.sourceforge.net
> >
> > When replying, please edit your Subject line so it is more specific
> > than "Re: Contents of Bind-dlz-testers digest..."
> >
> >
> > Today's Topics:
> >
> > 1. Re: dlz for bind 9.2.2 (Rob Butler)
> >
> > -- __--__--
> >
> > Message: 1
> > From: "Rob Butler" <robert.butler5 <at> verizon.net>
> > To: "Martin Svensson" <martin <at> stabilt.se>
> > Cc: <bind-dlz-testers <at> lists.sourceforge.net>
> > Date: Tue, 17 Jun 2003 21:08:20 -0400
> > Subject: [Bind-dlz-testers] Re: dlz for bind 9.2.2
> > Reply-To: bind-dlz-testers <at> lists.sourceforge.net
> >
> > Hello Martin,
> >
> > Please post all messages to the DLZ mailing list so everyone can benefit
> > from the archives. Thanks.
> >
> > I am not a big fan of that schema for a DLZ database, but it will work.
> You
> > need to be VERY careful when setting up your queries, especially with
> MySQL
> > functions.
> >
> > Carefully check your MySQL queries, and make sure that you DO NOT have a
> > space between the CONCAT_WS and the opening parenthesis. If you do the
> > query will not work. One thing that may be causing a problem is if you
> have
> > a space between CONCAT_WS and the opening parenthesis of the section of
> your
> > query after "when lower(type)='soa' ". This may cause the query to fail
> for
> > SOA records, but work for other record types.
> >
> > The other thing that you have to be careful of is the query positions in
> > named.conf for DLZ. Notice that there is an "empty" authority query for
> > this configuration. This is because the authority data is retrieved as
> part
> > of the lookup query so an authority query is not necessary. To
correctly
> > have an "empty" authority query you MUST have the brackets {} without
any
> > spaces in between. If there is a space in between you do not have an
> > "empty" query, but instead have a query of a single space. This may
also
> > cause the SOA records to fail.
> >
> > This is the best I can help by commenting on the config that is in the
> > e-mail archives. If you check the above items, and things are still not
> > working for you then e-mail a copy of the DLZ section of your named.conf
> to
> > the list, along with a SMALL sample of the data from your database. Be
> sure
> > to remove the database user / pass from the named.conf that you send.
> >
> > Hope this helps.
> > Later
> > Rob
> >
> >
> > >
> > > Hi,
> > >
> > > I found your email on the bind-dlz.sourceforge.net site.
> > >
> > > I am currently trying to get dlz to work with a database scheme I
found
> on
> > the mailing list. Bind responds satisfying on A/NS/MX records but the
SOA
> > does not work at all. I have tried in vain to get it to work so my
> question
> > is, do you have a good DB layout with a working named.conf? Or if you
have
> > the time it would be very appreciated if you can point in the right
> decision
> > of what is incorrect. The DB layout and named.conf can be found here:
> > http://sourceforge.net/mailarchive/message.php?msg_id=3833004
> > >
> > > Thank you very much if you have the time to take a look at it.
> > >
> > > Best regards,
> > > Martin Svensson
> > >
> > >
> >
> >
> >
> >
> > -- __--__--
> >
> > _______________________________________________
> > Bind-dlz-testers mailing list
> > Bind-dlz-testers <at> lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
> >
> >
> > End of Bind-dlz-testers Digest
> >
>
>
>
>
> --__--__--
>
> Message: 3
> From: Rob Butler <robert.butler5 <at> verizon.net>
> To: <bind-dlz-testers <at> lists.sourceforge.net>
> Subject: Re: [Bind-dlz-testers] Database problems (bad schema?)
> Date: Wed, 18 Jun 2003 15:18:27 -0400
> Reply-To: bind-dlz-testers <at> lists.sourceforge.net
>
> Martin,
>
> Your data is wrong for the dns_records table. SOA records are supposed to
be at the "apex" of the zone. i.e. the host should be " <at> ", not
"example.com" in the dns_records table. Update the data in your database
for this row and your SOA queries should work.
>
> Also, according to your SOA record, your primary name server for this zone
is "myip.hu.". Yet you have a NS record called ns1. If you intend for
ns1.example.com to be the primary name server for this zone then the SOA
data field should be "ns1" or "ns1.example.com." either one will work fine.
>
> Later
> Rob
>
> >
> > Hi all,
> >
> > I am trying to get DLZ to work with a schema that I found in the mailing
> > list archives. I chose this schema because it puts zone info in one
table
> > and the records in another table and not everything in just one big
table.
> > My intention is to use Mysql as database.
> >
> > The problem I have is that I can't get SOA Answers! If anyone has the
> > slightest idea please let me know.
> > If you have another schema that works well and is scalable please let me
> > know.
> >
> > The DB / Named.conf is as follows:
> >
> > # Table structure for table 'zone'
> > CREATE TABLE zone (
> > id int(11) unsigned NOT NULL auto_increment,
> > ttl int(11) unsigned NOT NULL default '86400',
> > zone varchar(255) NOT NULL default '',
> > client varchar(15) default NULL,
> > resp_person varchar(255) default 'hostmaster',
> > serial int(11) unsigned NOT NULL default '1',
> > refresh int(11) unsigned NOT NULL default '86400',
> > retry int(11) unsigned NOT NULL default '7200',
> > expire int(11) unsigned NOT NULL default '604800',
> > minimum int(11) unsigned NOT NULL default '86400',
> > PRIMARY KEY (id),
> > KEY zona (zone,client)
> > ) TYPE=MyISAM;
> >
> > # Table structure for table 'dns_records'
> > CREATE TABLE dns_records (
> > zone_id int(11) unsigned NOT NULL default '0',
> > type enum('SOA','NS','MX','A','CNAME','TXT','HINFO','PTR') NOT NULL
> > default 'SOA',
> > host varchar(255) default NULL,
> > mx_priority int(3) unsigned default NULL,
> > data varchar(255) default NULL,
> > KEY zh (zone_id,host)
> > ) TYPE=MyISAM;
> >
> > dlz "Mysql zone" {
> > database "mysql
> > {host=localhost user=******* pass=****** dbname=dns_data ssl=false}
> > {select id from zone 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
> > zone,dns_records where id=zone_id and zone = '%zone%' and host =
> > '%record%'}
> > {}
> > {select ttl, type, host, 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
> > zone,dns_records where id=zone_id and zone = '%zone%'}
> > {select id from zone where zone = '%zone%' and client='%client%'}
> > {}";
> > };
> >
> > mysql> select * from zone;
> >
+----+-------+-------------+--------+-------------+--------+---------+------
> > -+--------+---------+
> > | id | ttl | zone | client | resp_person | serial | refresh | retry |
expire
> > | minimum |
> >
+----+-------+-------------+--------+-------------+--------+---------+------
> > -+--------+---------+
> > | 1 | 86400 | example.com | NULL | hostmaster2 |1 | 86400 | 7200 |
604800 |
> > 86400 |
> >
+----+-------+-------------+--------+-------------+--------+---------+------
> > -+--------+---------+
> >
> >
> > mysql> select * from dns_records;
> > +---------+------+-------------+-------------+------------+
> > | zone_id | type | host | mx_priority | data |
> > +---------+------+-------------+-------------+------------+
> > | 1 | SOA | example.com | NULL |myip.hu. |
> > | 1 | NS | <at> | NULL | ns1 |
> > | 1 | A | ns1 | NULL |127.0.0.1 |
> > | 1 | A | www | NULL |10.10.10.1 |
> > +---------+------+-------------+-------------+------------+
> >
> > Thanks in advance all!
> >
> > Best regards,
> > Martin Svensson
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by: INetU
> > Attention Web Developers & Consultants: Become An INetU Hosting Partner.
> > Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
> > INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
> > _______________________________________________
> > Bind-dlz-testers mailing list
> > Bind-dlz-testers <at> lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
> >
>
>
>
>
> --__--__--
>
> _______________________________________________
> Bind-dlz-testers mailing list
> Bind-dlz-testers <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers
>
>
> End of Bind-dlz-testers Digest
>
>
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php