From 6f8679af81411f7994258708905e593ce9b786e9 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 5 Mar 2013 14:47:09 +0545 Subject: [PATCH 1/3] DNS Forwarder allow null forwarding address dnsmasq allows a blank forwarding IP address to be specified in --server parameters. In that case, dnsmasq will attempt a local lookup of the name (e.g. in hosts file), but will not forward the request on to the standard name servers. This is a useful way to prevent internal name requests from being sent out to the real internet name servers. --- etc/inc/services.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/inc/services.inc b/etc/inc/services.inc index 33e21683d8..8c69cb04b3 100644 --- a/etc/inc/services.inc +++ b/etc/inc/services.inc @@ -1559,7 +1559,9 @@ function services_dnsmasq_configure() { /* Setup forwarded domains */ if (isset($config['dnsmasq']['domainoverrides']) && is_array($config['dnsmasq']['domainoverrides'])) { foreach($config['dnsmasq']['domainoverrides'] as $override) { - $args .= ' --server=/' . $override['domain'] . '/' . $override['ip']; + if ($override['ip'] == "!") + $override[ip] = ""; + $args .= ' --server=/' . $override['domain'] . '/' . $override['ip']; } } From 4560c2d196e8f89a15098290a76255bae81d941e Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 5 Mar 2013 15:02:39 +0545 Subject: [PATCH 2/3] DNS Forwarder allow null forwarding address dnsmasq allows a blank forwarding IP address to be specified in --server parameters. In that case, dnsmasq will attempt a local lookup of the name (e.g. in hosts file), but will not forward the request on to the standard name servers. This is a useful way to prevent internal name requests from being sent out to the real internet name servers. --- usr/local/www/services_dnsmasq_domainoverride_edit.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr/local/www/services_dnsmasq_domainoverride_edit.php b/usr/local/www/services_dnsmasq_domainoverride_edit.php index 74869b4de1..9f26c8a1b8 100755 --- a/usr/local/www/services_dnsmasq_domainoverride_edit.php +++ b/usr/local/www/services_dnsmasq_domainoverride_edit.php @@ -86,8 +86,8 @@ if ($_POST) { elseif ($_POST['domain'] && !is_domain($_POST['domain'])) { $input_errors[] = gettext("A valid domain must be specified."); } - if ($_POST['ip'] && !is_ipaddr($_POST['ip']) && ($_POST['ip'] != '#')) { - $input_errors[] = gettext("A valid IP address must be specified, or # for an exclusion."); + if ($_POST['ip'] && !is_ipaddr($_POST['ip']) && ($_POST['ip'] != '#') && ($_POST['ip'] != '!')) { + $input_errors[] = gettext("A valid IP address must be specified, or # for an exclusion or ! to not forward at all."); } if ($_POST['dnssrcip'] && !in_array($_POST['dnssrcip'], get_configured_ip_addresses())) { $input_errors[] = gettext("An interface IP address must be specified for the DNS query source."); @@ -131,14 +131,14 @@ include("head.inc");

-
+

- 192.168.100.100
+ 192.168.100.100

From 5f5bd76b193efe545004d00ef9c7027f6d71dfc8 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 5 Mar 2013 15:31:14 +0545 Subject: [PATCH 3/3] DNS Forwarder example text It was a bit silly putting the examples inside gettext() calls - they should not be translated to other languages in this context. And I made it a "localdomain" example, to match the pfSense wizard default name. --- usr/local/www/services_dnsmasq_domainoverride_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/services_dnsmasq_domainoverride_edit.php b/usr/local/www/services_dnsmasq_domainoverride_edit.php index 9f26c8a1b8..52714c996d 100755 --- a/usr/local/www/services_dnsmasq_domainoverride_edit.php +++ b/usr/local/www/services_dnsmasq_domainoverride_edit.php @@ -131,7 +131,7 @@ include("head.inc");

-
+ mycompany.localdomain 1.168.192.in-addr.arpa