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
Updated by Jan Schneider over 13 years ago
I can confirm this bug, the zone information mus be supplied, otherwise the request won't be accepted by RFC2136 compliant DNS systems.
$upinst .= "zone example.com.\n";
In this example, the zone should be "example.com." note the dot at the end.
This needs to be configurable in the GUI.
$upinst .= "update delete {$dnsupdate['host']} A\n";
A delete isn't necessary, but doesn't do any harm.
Also the gui declines the use of usernames ending on a dot, this however is the correct and required notation of usernames and records in an update request.
Both need to be fixed in order to produce valid update requests.
Updated by Isaac McDonald over 13 years ago
I was able to get updates to work by putting the complete FQDN into the hostname portion. ex. host.example.com rather that just "host". The gui needs to be updated to reflect this requirement.
Updated by Isaac McDonald over 13 years ago
To further clarify, please update "host" field of the GUI for RFC 2136 updates to read "Fully qualified hostname of the host to be updated" or something to that effect.
Updated by Ermal Luçi over 13 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Applied in changeset b9eccc77815a3e9d4913fcad8f7c474291e9f67a.
Updated by Ermal Luçi over 13 years ago
Applied in changeset 5ebe85e9344abfe52f3dced34c8e4515b8a8d293.
Updated by Ermal Luçi over 13 years ago
- Status changed from Feedback to Resolved