[Pdns-users] SQL implementation questions

Derrik Pates dpates at dsdk12.net
Wed May 26 11:52:35 UTC 2004


Martin Kuchar wrote:
> The SOA record is as full text line recorded in one cell. Is this good
> choice ? It can not be better to have serial, refresh, retry, expire and
> minimum in separate columns or rows ? Its hard to parse and can be hole for
> future editing.

It'd be an excess pain in the ass, having to have separate columns just 
for that one row type. Bert doesn't seem to think the performance hit 
for parsing the SOA record's fields is significant enough to worry 
about, and it hasn't seemed to be an issue so far.

> Anybody know, how to get soa serial in one mysql select command ??

I'd do something like:

SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(r.content, ' ', -4), ' ', 1) FROM 
domain d LEFT JOIN records r ON d.id = r.domain_id WHERE d.name = 
'domain.name';

Of course, that's if you actually use the SOA serial number instead of 
automatic serial numbers. (Our nameservers at work do use autoserial.)

> There is TTL column in SOA row. It is used for something, or the TTL in SOA
> text line is sufficient ?

Each record has its own TTL. The TTL in the zone SOA is the "default 
TTL", which is only used for negative responses in zones that the server 
is authoritative for. Each record should have an appropriate TTL set. 
The frontend I wrote picks up the default TTL and uses that unless the 
user specifies a different value.

> There are TTL columns for each records too. Are the TTL here used too, or is
> used the one from SOA line ? Can be TTL of record independent to TTL from
> SOA line ?

Yes, as I said, each record has its own TTL value. (You can actually 
specify TTLs for each record in BIND zonefiles as well, but it's not 
used as often.)

> The prio column can be used to any records ? I know them only with MX, but
> it works for NS too ? Can this be used for A too ???

It's present on all records, obviously, but it only applies, far as I 
know, to MX and SRV records. You can set a value for other records, but 
it won't be used by PowerDNS.

-- 
Derrik Pates
dpates at dsdk12.net


More information about the Pdns-users mailing list