> Why not do something along the lines of (PostgreSQL syntax as that's
> what I know, and completely untested):
> 
> INSERT INTO records (domain_id, name, type, content, ttl)
>    SELECT domain.id, 'autoconfig.' || domains.name, 'CNAME, '<my autoconfig
> zone>, 3600
>        FROM domains
>        JOIN records ON domains.id = records.domain_id
>        WHERE domains.id NOT IN (
>            SELECT domains_id FROM records
>                JOIN domains ON domains.id = records.domain_id
>                WHERE name = 'autoconfig.' || domains.name );
> 
> You may want to just run the SELECT first to see that it gives you what
> you want.

When you insert records directly into the DB, the zone may be broken (NSEC, 
NSEC3 ordername, empty non-terminal RRs ...).

Therefore you have to call "rectify" for every zone that was changed and 
PowerDNS will check and if necessary fix the zone.

regards
Klaus
_______________________________________________
Pdns-users mailing list
Pdns-users@mailman.powerdns.com
https://mailman.powerdns.com/mailman/listinfo/pdns-users

Reply via email to