diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-09-02 02:41:58 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-09-02 02:41:58 +0200 |
| commit | 0769d1a47f09148ce7ee3206c185004bbefb9f0b (patch) | |
| tree | 891ce761d2baefb25c0df1ce16b58ce0c1a7f859 /roles/network | |
| parent | 4c59a5a3d07ab0aa72aed3663823bbf69eec647e (diff) | |
Refactor the network fix for pihole
Diffstat (limited to 'roles/network')
| -rw-r--r-- | roles/network/templates/resolved.conf.j2 | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/roles/network/templates/resolved.conf.j2 b/roles/network/templates/resolved.conf.j2 index 5d70fb96..ea4a818a 100644 --- a/roles/network/templates/resolved.conf.j2 +++ b/roles/network/templates/resolved.conf.j2 @@ -1,18 +1,8 @@ [Resolve] -{% if not (network_ipv4_dns is defined or network_ipv6_dns is defined) %} -# Only set global DNS (and DoT) if not using Pi-hole -# cloudflare-dns.com -DNS=1.1.1.1 2606:4700:4700::1111 -# dns.google -FallbackDNS=8.8.8.8 2001:4860:4860::8888 -DNSOverTLS=yes -DNSSEC=yes -{% else %} -# NetworkManager will provide DNS via Pi-hole, no global DNS needed -# Pi-hole doesn't support DoT/DNSSEC -DNSOverTLS=no -DNSSEC=no -{% endif %} +DNS={{ network_ipv4_dns | default('1.1.1.1 2606:4700:4700::1111') }} +FallbackDNS={{ network_ipv6_dns | default('8.8.8.8 2001:4860:4860::8888') }} +DNSOverTLS={{ 'no' if (network_ipv4_dns is defined or network_ipv6_dns is defined) else 'yes' }} +DNSSEC={{ 'no' if (network_ipv4_dns is defined or network_ipv6_dns is defined) else 'yes' }} # use interface-specific DNS when available but fall back to global (required for VPN DNS to work) Domains=~. |
