Add option for recursive dns forwarders

When forwarding to a specific domain only forwarding to authoritive servers is implemented by setting:

set service dns forwarding domain <domain.name> server <ip-address>

It would be useful if there is an option to flag the queries recursive. This enables the server with to ask other dns-servers it knows, when it is not authorative itself for a sub-domain of <domain.name>.

E.g.:
set service dns forwarding domain <domain.name> recursive

I’ve already made an example of the needed modifications to the configuration templates and dns_forwarding.py:

Adjustments to the configuration templates:

mkdir /opt/vyatta/share/vyatta-cfg/templates/service/dns/forwarding/domain/node.tag/recursive
echo "help: Perform recursive queries > /opt/vyatta/share/vyatta-cfg/templates/service/dns/forwarding/domain/node.tag/recursive/node.def

Modified dns_forwarding.py:

dns_forwarding.py.txt (8.2 KB)

Until I started looking into this, I didn’t realise that VyOS already supports recursive DNS resolution just by not configuring any forwarding servers:

VyOS DNS forwarder does not require an upstream DNS server. It can serve as a full recursive DNS server - but it can also forward queries to configurable upstream DNS servers. By not configuring any upstream DNS servers you also avoid to be tracked by the provider of your upstream DNS server.

All the configuration examples I previously saw, involved setting an upstream server.