aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2010-11-18 19:00:50 +0200
committerWarren Baker <warren@decoy.co.za>2010-11-18 19:00:50 +0200
commite617de347a3bc1cdd01f1db3fabfb7462eb81417 (patch)
tree7524813af505c5cb1a22ff429f4d88463cff03b8
parent1d892d512b47b716f64fc6a95ecf718e65e0026c (diff)
downloadpfsense-packages-e617de347a3bc1cdd01f1db3fabfb7462eb81417.tar.gz
pfsense-packages-e617de347a3bc1cdd01f1db3fabfb7462eb81417.tar.bz2
pfsense-packages-e617de347a3bc1cdd01f1db3fabfb7462eb81417.zip
Bump version number and correctly handle domain overrides including the ability to have duplicate domain override entries.
-rw-r--r--config/unbound/unbound.inc27
-rwxr-xr-xpkg_config.8.xml2
-rwxr-xr-xpkg_config.8.xml.amd642
3 files changed, 19 insertions, 12 deletions
diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc
index 120bc01b..3d4bc529 100644
--- a/config/unbound/unbound.inc
+++ b/config/unbound/unbound.inc
@@ -418,17 +418,24 @@ function unbound_add_domain_overrides() {
if (isset($config['dnsmasq']['domainoverrides'])) {
$domains = $config['dnsmasq']['domainoverrides'];
+
+ // Domain overrides that have multiple entries need multiple forward-addr: added
+ $sorted_domains = msort($domains, "domain");
+ $result = array();
+ foreach($sorted_domains as $domain) {
+ $domain_key = current($domain);
+ if(!isset($result[$domain_key])) {
+ $result[$domain_key] = array();
+ }
+ $result[$domain_key][] = $domain['ip'];
+ }
+
$domain_entries = "";
- $added_item = array();
- foreach($domains as $domain) {
- $current_domain = $domain['domain'];
- if(!$added_item[$current_domain]) {
- $domain_entries .= "local-zone: '{$domain['domain']}.' redirect\n";
- $domain_entries .= "local-data: '{$domain['domain']}. A {$domain['ip']}'\n";
- if (!empty($domain['descr']))
- $domain_entries .= "local-data: '{$domain['domain']}. TXT \"{$domain['descr']}\"'\n";
- // Do not add duplicate entries
- $added_item[$current_domain] = true;
+ foreach($result as $domain=>$ips) {
+ $domain_entries .= "forward-zone:\n";
+ $domain_entries .= "\tname: \"$domain\"\n";
+ foreach($ips as $ip) {
+ $domain_entries .= "\tforward-addr: $ip\n";
}
}
return $domain_entries;
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 0f124456..4e3b6199 100755
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -945,7 +945,7 @@
<descr>Unbound is a validating, recursive, and caching DNS resolver.</descr>
<website>http://www.unbound.net/</website>
<category>Services</category>
- <version>1.0</version>
+ <version>1.1</version>
<status>Alpha</status>
<required_version>2.0</required_version>
<pkginfolink>http://doc.pfsense.org/index.php/Unbound_package</pkginfolink>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index c44ce010..7cbf64b2 100755
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -961,7 +961,7 @@
<descr>Unbound is a validating, recursive, and caching DNS resolver.</descr>
<website>http://www.unbound.net/</website>
<category>Services</category>
- <version>1.0</version>
+ <version>1.1</version>
<status>Alpha</status>
<required_version>2.0</required_version>
<pkginfolink>http://doc.pfsense.org/index.php/Unbound_package</pkginfolink>