mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Add AAAA support to RFC2136 updates. Based on http://forum.pfsense.org/index.php/topic,50164.msg269138.html#msg269138
This commit is contained in:
parent
efe42b5a05
commit
2aacbacf83
@ -1952,7 +1952,8 @@ function services_dnsupdate_process($int = "") {
|
||||
/* determine interface name */
|
||||
$if = get_real_interface($dnsupdate['interface']);
|
||||
$wanip = get_interface_ip($dnsupdate['interface']);
|
||||
if ($wanip) {
|
||||
$wanipv6 = get_interface_ipv6($dnsupdate['interface']);
|
||||
if ($wanip || $wanipv6) {
|
||||
|
||||
$keyname = $dnsupdate['keyname'];
|
||||
/* trailing dot */
|
||||
@ -1997,8 +1998,16 @@ EOD;
|
||||
$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";
|
||||
/* Update IPv4 if we have it. */
|
||||
if (is_ipaddrv4($wanip)) {
|
||||
$upinst .= "update delete {$dnsupdate['host']}. A\n";
|
||||
$upinst .= "update add {$dnsupdate['host']}. {$dnsupdate['ttl']} A {$wanip}\n";
|
||||
}
|
||||
/* Update IPv6 if we have it. */
|
||||
if (is_ipaddrv6($wanipv6)) {
|
||||
$upinst .= "update delete {$dnsupdate['host']}. AAAA\n";
|
||||
$upinst .= "update add {$dnsupdate['host']}. {$dnsupdate['ttl']} AAAA {$wanipv6}\n";
|
||||
}
|
||||
$upinst .= "\n"; /* mind that trailing newline! */
|
||||
|
||||
@file_put_contents("{$g['varetc_path']}/nsupdatecmds{$i}", $upinst);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user