[Pdns-users] zone2sql bug/problem

Craig Whitmore lennon at orcon.net.nz
Wed Jun 29 12:05:35 UTC 2011



On 28/06/11 11:56 PM, "Thomas Andrews" <tandrews at grok.co.za> wrote:

>Hi,
>
>I have the debian package pdns-server version 2.9.22-8 installed.
>
>The zone2sql man page refers to an option  --startid=<id>
>This appears to be invalid though, because using it I get this error:

I have checked zone2sql in the latest version and.. Its quite broken and
works a little different

As the domain_id is a auto_increment number it makes no real difference
why you need to specify the start_id but if you wanted to in the zone2sql
its not used anyway as far as I can tell checking the source for the
latest version...

2.9.22-8 maybe completely different but..


pdns/backends/bind/zone2sql --gmysql=yes --zone=test.zone

insert into records (domain_id, name,type,content,ttl,prio) select id
,'example.com', 'SOA', 'ns1.example.com. hostmaster.example.com.
2002022401 10800 15 604800 10800', 86400, 0 from domains where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'example.com', 'NS', 'ns1.example.com', 86400, 0 from domains where
name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'example.com', 'NS', 'ns2.smokeyjoe.com', 86400, 0 from domains where
name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'example.com', 'MX', 'mail.another.com', 86400, 10 from domains where
name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'ns1.example.com', 'A', '192.168.0.1', 86400, 0 from domains where
name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'www.example.com', 'A', '192.168.0.2', 86400, 0 from domains where
name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'ftp.example.com', 'CNAME', 'www.example.com', 86400, 0 from domains
where name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'bill.example.com', 'A', '192.168.0.3', 86400, 0 from domains where
name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'fred.example.com', 'A', '192.168.0.4', 86400, 0 from domains where
name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'1.example.com', 'CNAME', '1.0.example.com', 86400, 0 from domains where
name='';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'2.example.com', 'CNAME', '2.0.example.com', 86400, 0 from domains where
name='';


It doesn't figure out the domain name from the $ORIGIN in the file and its
missing the insert into domains line!!

I see no real reason to use start-id these days.

You have to use to get the zone file showing right

pdns/backends/bind/zone2sql --start-id=4 --gmysql=yes --zone=test.zone
--zone-name=example.com
insert into records (domain_id, name,type,content,ttl,prio) select id
,'example.com', 'SOA', 'ns1.example.com. hostmaster.example.com.
2002022401 10800 15 604800 10800', 86400, 0 from domains where
name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'example.com', 'NS', 'ns1.example.com', 86400, 0 from domains where
name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'example.com', 'NS', 'ns2.smokeyjoe.com', 86400, 0 from domains where
name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'example.com', 'MX', 'mail.another.com', 86400, 10 from domains where
name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'ns1.example.com', 'A', '192.168.0.1', 86400, 0 from domains where
name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'www.example.com', 'A', '192.168.0.2', 86400, 0 from domains where
name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'ftp.example.com', 'CNAME', 'www.example.com', 86400, 0 from domains
where name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'bill.example.com', 'A', '192.168.0.3', 86400, 0 from domains where
name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'fred.example.com', 'A', '192.168.0.4', 86400, 0 from domains where
name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'1.example.com', 'CNAME', '1.0.example.com', 86400, 0 from domains where
name='example.com';
insert into records (domain_id, name,type,content,ttl,prio) select id
,'2.example.com', 'CNAME', '2.0.example.com', 86400, 0 from domains where
name='example.com';


But the insert into domains is missing..

I'll write a patch for it maybe in the next week..











>





More information about the Pdns-users mailing list