From 06266c34e2722d7cce180b2b5e0fdbec198a9065 Mon Sep 17 00:00:00 2001 From: Lorenz Schori Date: Thu, 19 Feb 2015 10:45:41 +0100 Subject: [PATCH] Do not add PTR records for aliases in host overrides --- etc/inc/unbound.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etc/inc/unbound.inc b/etc/inc/unbound.inc index 8641ddb3e8..027375b20e 100644 --- a/etc/inc/unbound.inc +++ b/etc/inc/unbound.inc @@ -504,6 +504,7 @@ function unbound_add_host_entries() { $unbound_entries = "local-zone: \"{$config['system']['domain']}\" transparent\n"; $hosts = read_hosts(); + $added_ptr = array(); foreach ($hosts as $host) { if (is_ipaddrv4($host['ipaddr'])) $type = 'A'; @@ -512,7 +513,10 @@ function unbound_add_host_entries() { else continue; - $unbound_entries .= "local-data-ptr: \"{$host['ipaddr']} {$host['fqdn']}\"\n"; + if(!$added_ptr[$host['ip']]) { + $unbound_entries .= "local-data-ptr: \"{$host['ipaddr']} {$host['fqdn']}\"\n"; + $added_ptr[$host['ip']] = true; + } $unbound_entries .= "local-data: \"{$host['fqdn']} {$type} {$host['ipaddr']}\"\n"; if (isset($host['name'])) $unbound_entries .= "local-data: \"{$host['name']} {$type} {$host['ipaddr']}\"\n";