diff options
author | jim-p <jimp@pfsense.org> | 2013-06-24 13:33:02 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-06-24 13:33:02 -0400 |
commit | 2aacbacf83223db4678be3f2fa266624d65cd4ae (patch) | |
tree | 1d0043574625dd51b800a2c67385cb217a9e9786 /etc/inc/services.inc | |
parent | efe42b5a05dfc7c718b04fb00391f251d846a2f2 (diff) | |
download | pfsense-2aacbacf83223db4678be3f2fa266624d65cd4ae.zip pfsense-2aacbacf83223db4678be3f2fa266624d65cd4ae.tar.gz |
Add AAAA support to RFC2136 updates. Based on http://forum.pfsense.org/index.php/topic,50164.msg269138.html#msg269138
Diffstat (limited to 'etc/inc/services.inc')
-rw-r--r-- | etc/inc/services.inc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 169d37f..f33742c 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -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); |