diff --git a/roles/unwind/templates/unwind.conf.j2 b/roles/unwind/templates/unwind.conf.j2 index 2a704ce..20af19f 100644 --- a/roles/unwind/templates/unwind.conf.j2 +++ b/roles/unwind/templates/unwind.conf.j2 @@ -1,10 +1,15 @@ {% if network_dns_servers is defined %} forwarder { {% for addr in network_dns_servers %} - {{ addr }} port 853 authentication name "{{ lookup('community.general.dig', addr + '/PTR')[:-1] }}" DoT +{% set reverse = lookup('community.general.dig', addr + '/PTR')[:-1] %} +{% if reverse != "NXDOMAI" %} + {{ addr }} port 853 authentication name "{{ reverse }}" DoT +{% else %} + {{ addr }} port 53 +{% endif %} {% endfor %} } -preference { DoT } +preference { DoT forwarder } {% else %} preference { oDoT-autoconf } {% endif %}