diff --git a/src/etc/inc/services.inc b/src/etc/inc/services.inc index 8d713533f..64f6411bd 100644 --- a/src/etc/inc/services.inc +++ b/src/etc/inc/services.inc @@ -1748,7 +1748,7 @@ EOD; $need_update = false; /* Update IPv4 if we have it. */ - if (is_ipaddrv4($wanip)) { + if (is_ipaddrv4($wanip) && (empty($dnsupdate['recordtype']) || $dnsupdate['recordtype'] == 'A')) { if (($wanip != $cachedipv4) || (($currentTime - $cacheTimev4) > $maxCacheAgeSecs) || $forced) { $upinst .= "update delete {$dnsupdate['host']}. A\n"; $upinst .= "update add {$dnsupdate['host']}. {$dnsupdate['ttl']} A {$wanip}\n"; @@ -1764,7 +1764,7 @@ EOD; } /* Update IPv6 if we have it. */ - if (is_ipaddrv6($wanipv6)) { + if (is_ipaddrv6($wanipv6) && (empty($dnsupdate['recordtype']) || $dnsupdate['recordtype'] == 'AAAA')) { if (($wanipv6 != $cachedipv6) || (($currentTime - $cacheTimev6) > $maxCacheAgeSecs) || $forced) { $upinst .= "update delete {$dnsupdate['host']}. AAAA\n"; $upinst .= "update add {$dnsupdate['host']}. {$dnsupdate['ttl']} AAAA {$wanipv6}\n"; diff --git a/src/www/services_rfc2136.php b/src/www/services_rfc2136.php index c04fd4672..b9a2ac8ca 100644 --- a/src/www/services_rfc2136.php +++ b/src/www/services_rfc2136.php @@ -140,7 +140,7 @@ $main_buttons = array( "; - if (file_exists("{$filename}.ipv6")) { + if (file_exists("{$filename}.ipv6") && !empty($rfc2136['enable']) && (empty($dnsupdate['recordtype']) || $dnsupdate['recordtype'] == 'AAAA')) { echo "IPv6: "; $ipaddr = get_interface_ipv6($rfc2136['interface']); $cached_ip_s = explode("|", file_get_contents("{$filename}.ipv6")); diff --git a/src/www/services_rfc2136_edit.php b/src/www/services_rfc2136_edit.php index b8d34e8f1..119f88c03 100644 --- a/src/www/services_rfc2136_edit.php +++ b/src/www/services_rfc2136_edit.php @@ -58,6 +58,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['usetcp'] = isset($a_rfc2136[$id]['usetcp']); $pconfig['usepublicip'] = isset($a_rfc2136[$id]['usepublicip']); + $pconfig['recordtype'] = isset($id) && !empty($a_rfc2136[$id]['recordtype']) ? $a_rfc2136[$id]['recordtype'] : null; + } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { if (isset($_POST['id']) && !empty($a_rfc2136[$_POST['id']])) { $id = $_POST['id']; @@ -93,6 +95,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $rfc2136['server'] = $pconfig['server']; $rfc2136['usetcp'] = !empty($pconfig['usetcp']); $rfc2136['usepublicip'] = !empty($pconfig['usepublicip']); + $rfc2136['recordtype'] = $_POST['recordtype']; $rfc2136['interface'] = $pconfig['interface']; $rfc2136['descr'] = $pconfig['descr']; @@ -221,6 +224,17 @@ include("head.inc"); + + + + />   + />   + /> + + +