Revision fc1f4960
Added by Jim Pingle almost 12 years ago
etc/inc/services.inc | ||
---|---|---|
1956 | 1956 |
/* determine interface name */ |
1957 | 1957 |
$if = get_real_interface($dnsupdate['interface']); |
1958 | 1958 |
$wanip = get_interface_ip($dnsupdate['interface']); |
1959 |
if ($wanip) { |
|
1959 |
$wanipv6 = get_interface_ipv6($dnsupdate['interface']); |
|
1960 |
if ($wanip || $wanipv6) { |
|
1960 | 1961 |
|
1961 | 1962 |
$keyname = $dnsupdate['keyname']; |
1962 | 1963 |
/* trailing dot */ |
... | ... | |
2001 | 2002 |
$upinst = ""; |
2002 | 2003 |
if (!empty($dnsupdate['server'])) |
2003 | 2004 |
$upinst .= "server {$dnsupdate['server']}\n"; |
2004 |
$upinst .= "update delete {$dnsupdate['host']} A\n"; |
|
2005 |
$upinst .= "update add {$dnsupdate['host']} {$dnsupdate['ttl']} A {$wanip}\n"; |
|
2005 |
/* Update IPv4 if we have it. */ |
|
2006 |
if (is_ipaddrv4($wanip)) { |
|
2007 |
$upinst .= "update delete {$dnsupdate['host']}. A\n"; |
|
2008 |
$upinst .= "update add {$dnsupdate['host']}. {$dnsupdate['ttl']} A {$wanip}\n"; |
|
2009 |
} |
|
2010 |
/* Update IPv6 if we have it. */ |
|
2011 |
if (is_ipaddrv6($wanipv6)) { |
|
2012 |
$upinst .= "update delete {$dnsupdate['host']}. AAAA\n"; |
|
2013 |
$upinst .= "update add {$dnsupdate['host']}. {$dnsupdate['ttl']} AAAA {$wanipv6}\n"; |
|
2014 |
} |
|
2006 | 2015 |
$upinst .= "\n"; /* mind that trailing newline! */ |
2007 | 2016 |
|
2008 | 2017 |
@file_put_contents("{$g['varetc_path']}/nsupdatecmds{$i}", $upinst); |
Also available in: Unified diff
Add AAAA support to RFC2136 updates. Based on http://forum.pfsense.org/index.php/topic,50164.msg269138.html#msg269138