diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc index 13b84228e..becf13d31 100644 --- a/src/etc/inc/system.inc +++ b/src/etc/inc/system.inc @@ -304,22 +304,24 @@ function get_dns_servers() return array_unique($dns_servers); } -function get_nameservers() +function get_nameservers($realif = '') { $master_list = array(); - $dns_lists = glob('/var/etc/nameserver_*'); + $dns_listsv4 = glob("/var/etc/nameserver_{$realif}*"); + /* XXX not a great design, please switch */ + $dns_listsv6 = glob("/var/etc/nameserver_v6{$realif}*"); - if (is_array($dns_lists)) { - foreach ($dns_lists as $fdns) { - $contents = file($fdns, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - if (!is_array($contents)) { - continue; - } - foreach ($contents as $dns) { - if (!empty($dns) && is_ipaddr($dns)) { - $master_list[] = $dns; - } + $dns_lists = array_unique(array_merge($dns_listsv4, $dns_listsv6)); + + foreach ($dns_lists as $fdns) { + $contents = file($fdns, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); + if (!is_array($contents)) { + continue; + } + foreach ($contents as $dns) { + if (!empty($dns) && is_ipaddr($dns)) { + $master_list[] = $dns; } } } diff --git a/src/www/status_interfaces.php b/src/www/status_interfaces.php index a0b527dec..98b2e782c 100644 --- a/src/www/status_interfaces.php +++ b/src/www/status_interfaces.php @@ -328,6 +328,19 @@ include("head.inc");