Bug #1327
closedRFC 2136 dynamic dns bug
100%
Description
Per this forum post: http://forum.pfsense.org/index.php/topic,33824.0/topicseen.html I am submitting a bug report:
RFC 2136 dynamic DNS updates do not work in RC1. I did some searching and found the solution http://www.docunext.com/wiki/PfSense#TSIG_DNS_Updates.
The GUI is missing a field for a domain name. The solution is to modify the /etc/inc/services.inc file to include your domain name and add a few extra lines.
Code:
/* generate update instructions /
$upinst = "";
if (!empty($dnsupdate['server']))
$upinst .= "server {$dnsupdate['server']}\n";
$upinst .= "zone example.com\n";
$upinst .= "key {$dnsupdate['keyname']} {$dnsupdate['keydata']}\n";
$upinst .= "update add {$dnsupdate['host']} {$dnsupdate['ttl']} A {$wanip}\n";
$upinst .= "send\n";
$upinst .= "\n"; / mind that trailing newline! */
$fd = fopen("{$g['varetc_path']}/nsupdatecmds{$i}", "w");
fwrite($fd, $upinst);
fclose($fd);
end code:
The unmodified version of /etc/inc/services.inc looks like this:
code:
/* generate update instructions /
$upinst = "";
if (!empty($dnsupdate['server']))
$upinst .= "server {$dnsupdate['server']}\n";
$upinst .= "update delete {$dnsupdate['host']} A\n";
$upinst .= "update add {$dnsupdate['host']} {$dnsupdate['ttl']} A {$wanip}\n";
$upinst .= "\n"; / mind that trailing newline! */
$fd = fopen("{$g['varetc_path']}/nsupdatecmds{$i}", "w");
fwrite($fd, $upinst);
fclose($fd);
end code:
The "update delete" line is not needed to update an existing A record.
The syntax I am using can be found here:
https://www.dyndns.com/support/kb/ddns_updates_and_tsig.html