[Pdns-users] Adding multiple records to all zones at once

Andrea Biancalani a.biancalani at conmet.it
Thu Oct 12 18:13:53 UTC 2023


Hi all,

I know this is not strictly related to PDNS only, but an help will be 
really appreciated.

Thanks to anyone givin' a cent.

Il 04/10/2023 18:42, Andrea Biancalani via Pdns-users ha scritto:
> Hello there,
>
> I'm using latest PDNS server authoritative with MySQL backend and I 
> want to autoadd 2 records (autodiscover/autoconfig CNAMEs) for each 
> zone available in my db (that has not those records already set), to 
> make it more clear:
>
> Example.
>
>     *zone1.tld*
>
>         autodiscover.zone1.tld    CNAME autodiscover.outlook.com    3600
>         autoconfig.zones1.tld    CNAME autoconfig.outlook.com    3600
>
>     *zone2.tld*
>
>         none
>
>
>     *zone3.tld*
>
>         none
>
>
>     *zone4.tld*
>
>         autodiscover.zone4.tld    CNAME autodiscover.outlook.com    3600
>         autoconfig.zones4.tld    CNAME autoconfig.outlook.com    3600
>
>
>     *zone5.tld*
>
>         autodiscover.zone5.tld    CNAME autodiscover.outlook.com    3600
>         autoconfig.zones5.tld    CNAME autoconfig.outlook.com    3600
>
> Using powerdns db in a mysql shell I can prompt this command
>
>     insert into records(domain_id,name,type,content,ttl) VALUES
>     ("*2*","autoconfig.*zonename.tld*","CNAME","/*<my autoconfig
>     zone>*/","3600");
>     insert into records(domain_id,name,type,content,ttl) VALUES
>     ("*2*","autodiscover.*zonename.tld*","CNAME","/*<my autodiscover
>     zone>*/","3600");
>
>
> but I need to extract all my zones within a script, than use a script 
> to extract only null zone IDs, than push values inside db: not so 
> practical.
>
> Is there any way to avoid this and push those values inside not 
> overwriting existing values (where already set)?
>
> After this I'll schedule a "pdnsutil increase-serial" loop to increase 
> SOA serials and propagate those differences to slaves with AXFR.
>
> Any help is more than welcome!
>
> Thanks all.
>
>
>
>
> _______________________________________________
> Pdns-users mailing list
> Pdns-users at mailman.powerdns.com
> https://mailman.powerdns.com/mailman/listinfo/pdns-users

-- 
Andrea Biancalani - /Rep. Commerciale e Tecnico/
*Connessioni Metropolitane srl*
Via G. Valentini, 14 - Prato (PO) - 59100
Sito web: https://www.conmet.it
Tel. 0574 536553
Fax. 0574 536554
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20231012/8106b66a/attachment.htm>


More information about the Pdns-users mailing list