<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
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
autodiscover.outlook.com 3600<br>
autoconfig.zones1.tld CNAME autoconfig.outlook.com 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
autodiscover.outlook.com 3600<br>
autoconfig.zones4.tld CNAME autoconfig.outlook.com 3600<br>
</blockquote>
<br>
<b>zone5.tld</b><br>
<blockquote>autodiscover.zone5.tld CNAME
autodiscover.outlook.com 3600<br>
autoconfig.zones5.tld CNAME autoconfig.outlook.com 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>
</body>
</html>