DynDNS: Difference between revisions

From Jan's Wiki
Jump to navigation Jump to search
(Created page with "Add to pdns.conf: experimental-dnsupdate=yes allow-dnsupdate-from= Check the domain id in psql sudo psql -U powerdns -W powerdns select id from domains where name='conti....")
 
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 12: Line 12:


For reference see here [https://doc.powerdns.com/html/dnsupdate-howto.html]
For reference see here [https://doc.powerdns.com/html/dnsupdate-howto.html]
On OpenWRT create the following script in /usr/lib/ddns/update_nsupdate.sh :
#!/bin/sh
[ $use_ipv6 -eq 1 ] && rrtype="AAAA" || rrtype="A"
echo "Update $domain to ip $__IP $rrtype"
cat <<EOF  | /usr/bin/nsupdate -y $username:$password
server $dns_server
update del $domain $rrtype
update add $domain 60 $rrtype $__IP
send
EOF
In OpenWRT DDNS put custom script /usr/lib/ddns/update_nsupdate.sh, username dyndns, password ReplaceWithBase64Key==, domain dyn.conti.work

Latest revision as of 21:26, 25 February 2015

Add to pdns.conf:

experimental-dnsupdate=yes
allow-dnsupdate-from=

Check the domain id in psql

sudo psql -U powerdns -W powerdns
select id from domains where name='conti.work';

insert into domainmetadata(domain_id, kind, content) values(DOMAINIDHERE, 'ALLOW-DNSUPDATE-FROM','172.16.0.0/16');
insert into tsigkeys (name, algorithm, secret) values ('dyndns', 'hmac-md5', 'ReplaceWithBase64Key==');
insert into domainmetadata (domain_id, kind, content) values (DOMAINIDHERE, 'TSIG-ALLOW-DNSUPDATE', 'dyndns');

For reference see here [1]

On OpenWRT create the following script in /usr/lib/ddns/update_nsupdate.sh :

#!/bin/sh
[ $use_ipv6 -eq 1 ] && rrtype="AAAA" || rrtype="A"
echo "Update $domain to ip $__IP $rrtype"
cat <<EOF  | /usr/bin/nsupdate -y $username:$password
server $dns_server
update del $domain $rrtype
update add $domain 60 $rrtype $__IP
send
EOF

In OpenWRT DDNS put custom script /usr/lib/ddns/update_nsupdate.sh, username dyndns, password ReplaceWithBase64Key==, domain dyn.conti.work