From e80da3c57d0501d7a5962fcacd6416d47385e86a Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sat, 23 May 2015 16:28:12 -0400 Subject: pfBlockerNG v1.09 --- config/pfblockerng/pfblockerng_diag_dns.php | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'config/pfblockerng/pfblockerng_diag_dns.php') diff --git a/config/pfblockerng/pfblockerng_diag_dns.php b/config/pfblockerng/pfblockerng_diag_dns.php index b44bc71c..fa238b7a 100644 --- a/config/pfblockerng/pfblockerng_diag_dns.php +++ b/config/pfblockerng/pfblockerng_diag_dns.php @@ -56,15 +56,6 @@ foreach ($a_aliases as $a) { $counter++; } -# Collect pfSense Version -$pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); - -if ($pfs_version > '2.2') { - $cmd = '/usr/bin/drill'; -} else { - $cmd = '/usr/bin/dig'; -} - if (isset($_POST['create_alias']) && (is_hostname($host) || is_ipaddr($host))) { if ($_POST['override']) { $override = true; @@ -73,7 +64,7 @@ if (isset($_POST['create_alias']) && (is_hostname($host) || is_ipaddr($host))) { $type = "hostname"; if ($resolved) { $resolved = array(); - exec("{$cmd} {$host_esc} A | /usr/bin/grep {$host_esc} | /usr/bin/grep -v ';' | /usr/bin/awk '{ print $5 }'", $resolved); + exec("/usr/bin/drill {$host_esc} A | /usr/bin/grep {$host_esc} | /usr/bin/grep -v ';' | /usr/bin/awk '{ print $5 }'", $resolved); $isfirst = true; foreach ($resolved as $re) { if ($re <> "") { @@ -120,7 +111,7 @@ if ($_POST) { $dns_servers = array(); exec("/usr/bin/grep nameserver /etc/resolv.conf | /usr/bin/cut -f2 -d' '", $dns_servers); foreach ($dns_servers as $dns_server) { - $query_time = exec("{$cmd} {$host_esc} " . escapeshellarg("@" . trim($dns_server)) . " | /usr/bin/grep Query | /usr/bin/cut -d':' -f2"); + $query_time = exec("/usr/bin/drill {$host_esc} " . escapeshellarg("@" . trim($dns_server)) . " | /usr/bin/grep Query | /usr/bin/cut -d':' -f2"); if ($query_time == "") { $query_time = gettext("No response"); } @@ -149,7 +140,7 @@ if ($_POST) { $resolved = gethostbyname($host); if ($resolved) { $resolved = array(); - exec("{$cmd} {$host_esc} A | /usr/bin/grep {$host_esc} | /usr/bin/grep -v ';' | /usr/bin/awk '{ print $5 }'", $resolved); + exec("/usr/bin/drill {$host_esc} A | /usr/bin/grep {$host_esc} | /usr/bin/grep -v ';' | /usr/bin/awk '{ print $5 }'", $resolved); } $hostname = $host; if ($host != $resolved) { @@ -208,7 +199,7 @@ include("head.inc"); ?> -  =  +    - - + +
@@ -271,7 +262,7 @@ include("head.inc"); ?> endforeach; ?>
- + -- cgit v1.2.3