<div dir="ltr">This seems a lot safer, and perhaps even easier, if you were to use the API to do it with python or similar.<div><br></div><div><a href="https://doc.powerdns.com/authoritative/http-api/zone.html">https://doc.powerdns.com/authoritative/http-api/zone.html</a><br></div><div><br></div><div>* Query to get list of all zones - GET `/servers/0/zones`</div><div><br></div><div>* Loop through each zones to add record(s)</div><div><br></div><div>Cheers,</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 12, 2023 at 1:14 PM Andrea Biancalani via Pdns-users <<a href="mailto:pdns-users@mailman.powerdns.com">pdns-users@mailman.powerdns.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div bgcolor="#FFFFFF">
<br>
Hi all, <br>
<br>
I know this is not strictly related to PDNS only, but an help will
be really appreciated. <br>
<br>
Thanks to anyone givin' a cent.<br>
<br>
<div>Il 04/10/2023 18:42, Andrea Biancalani
via Pdns-users ha scritto:<br>
</div>
<blockquote type="cite">
Hello there, <br>
<br>
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:<br>
<br>
Example.<br>
<br>
<blockquote><b>zone1.tld</b><br>
<blockquote>autodiscover.zone1.tld CNAME
<a href="http://autodiscover.outlook.com" target="_blank">autodiscover.outlook.com</a> 3600<br>
autoconfig.zones1.tld CNAME <a href="http://autoconfig.outlook.com" target="_blank">autoconfig.outlook.com</a> 3600<br>
</blockquote>
<b>zone2.tld</b><br>
<blockquote>none<br>
</blockquote>
<br>
<b>zone3.tld</b><br>
<blockquote>none<br>
</blockquote>
<br>
<b>zone4.tld</b><br>
<blockquote>autodiscover.zone4.tld CNAME
<a href="http://autodiscover.outlook.com" target="_blank">autodiscover.outlook.com</a> 3600<br>
autoconfig.zones4.tld CNAME <a href="http://autoconfig.outlook.com" target="_blank">autoconfig.outlook.com</a> 3600<br>
</blockquote>
<br>
<b>zone5.tld</b><br>
<blockquote>autodiscover.zone5.tld CNAME
<a href="http://autodiscover.outlook.com" target="_blank">autodiscover.outlook.com</a> 3600<br>
autoconfig.zones5.tld CNAME <a href="http://autoconfig.outlook.com" target="_blank">autoconfig.outlook.com</a> 3600<br>
<br>
</blockquote>
</blockquote>
Using powerdns db in a mysql shell I can prompt this command<br>
<br>
<blockquote>insert into records(domain_id,name,type,content,ttl)
VALUES ("<b>2</b>","autoconfig.<b>zonename.tld</b>","CNAME","<i><b><my
autoconfig zone></b></i>","3600");<br>
insert into records(domain_id,name,type,content,ttl) VALUES ("<b>2</b>","autodiscover.<b>zonename.tld</b>","CNAME","<i><b><my
autodiscover zone></b></i>","3600");<br>
</blockquote>
<br>
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. <br>
<br>
Is there any way to avoid this and push those values inside not
overwriting existing values (where already set)? <br>
<br>
After this I'll schedule a "pdnsutil increase-serial" loop to
increase SOA serials and propagate those differences to slaves
with AXFR.<br>
<br>
Any help is more than welcome!<br>
<br>
Thanks all.<br>
<br>
<br>
<br>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
Pdns-users mailing list
<a href="mailto:Pdns-users@mailman.powerdns.com" target="_blank">Pdns-users@mailman.powerdns.com</a>
<a href="https://mailman.powerdns.com/mailman/listinfo/pdns-users" target="_blank">https://mailman.powerdns.com/mailman/listinfo/pdns-users</a>
</pre>
</blockquote>
<br>
<div>-- <br>
Andrea Biancalani - <i>Rep. Commerciale e Tecnico</i><br>
<b>Connessioni Metropolitane srl</b><br>
Via G. Valentini, 14 - Prato (PO) - 59100<br>
Sito web: <a href="https://www.conmet.it" target="_blank">https://www.conmet.it</a><br>
Tel. 0574 536553<br>
Fax. 0574 536554<br>
</div>
</div>
_______________________________________________<br>
Pdns-users mailing list<br>
<a href="mailto:Pdns-users@mailman.powerdns.com" target="_blank">Pdns-users@mailman.powerdns.com</a><br>
<a href="https://mailman.powerdns.com/mailman/listinfo/pdns-users" rel="noreferrer" target="_blank">https://mailman.powerdns.com/mailman/listinfo/pdns-users</a><br>
</blockquote></div>