end
end
+ if not nodeinfo['hoster']['nameservers'] or nodeinfo['hoster']['nameservers'].empty?
+ # no nameservers known for this hoster
+ results['misc']['resolver-recursive'] = true
+ elsif (nodeinfo['hoster']['nameservers'] & nodeinfo['misc']['v4addrs']).size > 0 or
+ (nodeinfo['hoster']['nameservers'] & nodeinfo['misc']['v6addrs']).size > 0
+ # this host is listed as a nameserver at this location
+ results['misc']['resolver-recursive'] = true
+ else
+ results['misc']['resolver-recursive'] = false
+ end
+
return(results)
end
end
auto-trust-anchor-file: "/var/lib/unbound/root.key"
auto-trust-anchor-file: "/var/lib/unbound/debian.org.key"
-#forward-zone:
-# name: "."
-# forward-addr: 192.0.2.1
-# forward-addr: 192.0.2.199
+<%=
+ out = []
+ unless results['misc']['resolver-recursive']
+ forwarders = nodeinfo['hoster']['nameservers']
+ forwarders ||= []
+
+ out << 'forward-zone:'
+ out << ' name: "."'
+ forwarders.each do |ns|
+ out << " forward-addr: #{ns}"
+ end
+ end
+ out.join("\n")
+%>