From fb5105f8852a043a0de890e6660c97fd9fce745b Mon Sep 17 00:00:00 2001 From: Warren Baker Date: Thu, 18 Nov 2010 15:16:24 +0200 Subject: Only add TXT records if there is a description for host entries. --- config/unbound/unbound.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config/unbound') diff --git a/config/unbound/unbound.inc b/config/unbound/unbound.inc index 2068ae76..40e623b5 100644 --- a/config/unbound/unbound.inc +++ b/config/unbound/unbound.inc @@ -389,7 +389,8 @@ function unbound_add_host_entries() { $current_host = $host['host']; if(!$added_item[$current_host]) { $host_entries .= "\tlocal-data: '{$host['host']}.{$host['domain']}. IN A {$host['ip']}'\n"; - $host_entries .= "\tlocal-data: '{$host['host']}.{$host['domain']}. TXT \"{$host['descr']}\"'\n"; + if (!empty($host['descr'])) + $host_entries .= "\tlocal-data: '{$host['host']}.{$host['domain']}. TXT \"{$host['descr']}\"'\n"; // Do not add duplicate entries $added_item[$current_host] = true; } @@ -412,7 +413,8 @@ function unbound_add_domain_overrides() { if(!$added_item[$current_domain]) { $domain_entries .= "local-zone: '{$domain['domain']}.' redirect\n"; $domain_entries .= "\tlocal-data: '{$domain['domain']}. A {$domain['ip']}'\n"; - $domain_entries .= "\tlocal-data: '{$domain['domain']}. TXT \"{$domain['descr']}\"'\n"; + if (!empty($domain['descr'])) + $domain_entries .= "\tlocal-data: '{$domain['domain']}. TXT \"{$domain['descr']}\"'\n"; // Do not add duplicate entries $added_item[$current_domain] = true; } -- cgit v1.2.3