Currently, there is a note in the CNAME entry page stating the below:
Note:
The target of aCNAME
must be a domain that the Pi-hole already has in its cache or is authoritative for. This is a universal limitation ofCNAME
records.
The reason for this is that Pi-hole will not send additional queries upstream when servingCNAME
replies. As consequence, if you set a target that isn't already known, the reply to the client may be incomplete. Pi-hole just returns the information it knows at the time of the query. This results in certain limitations forCNAME
targets, for instance, only active DHCP leases work as targets - mere DHCP leases aren't sufficient as they aren't (yet) valid DNS records.
Additionally, you can'tCNAME
external domains (bing.com
togoogle.com
) successfully as this could result in invalid SSL certificate errors when the target server does not serve content for the requested domain.
The point of SSL not being valid is true, but support for this is needed for split DNS configurations. The note says it is a universal limitation of CNAME, but my Windows DNS server can clearly recursively resolve non authoritative requests as shown below. Can this be implemented in Pi-hole?
C:\Users\adyan\Desktop>nslookup test.adyanth.lan 10.10.10.4
Server: windows-server-nuc.adyanth.lan
Address: 10.10.10.4
Name: one.one.one.one
Addresses: 2606:4700:4700::1111
2606:4700:4700::1001
1.1.1.1
1.0.0.1
Aliases: test.adyanth.lan
As opposed to Pi-hole doing this:
C:\Users\adyan\Desktop>nslookup test.adyanth.site 10.10.10.3
Server: ubuntu-nuc.adyanth.lan
Address: 10.10.10.3
Name: test.adyanth.site
C:\Users\adyan\Desktop>nslookup one.one.one.one 10.10.10.3
Server: ubuntu-nuc.adyanth.lan
Address: 10.10.10.3
Non-authoritative answer:
Name: one.one.one.one
Addresses: 2606:4700:4700::1111
2606:4700:4700::1001
1.0.0.1
1.1.1.1
C:\Users\adyan\Desktop>nslookup test.adyanth.site 10.10.10.3
Server: ubuntu-nuc.adyanth.lan
Address: 10.10.10.3
Non-authoritative answer:
Name: one.one.one.one
Addresses: 2606:4700:4700::1001
2606:4700:4700::1111
1.1.1.1
1.0.0.1
Aliases: test.adyanth.site
Background on use case:
I have a local lan domain and a valid DNS domain. Many of the services I host are accessible via the internet using Cloudflare Tunnels. The public DNS entry points to the tunnel. The lan domain has the windows server as the authoritative domain and pihole has a custom override to send all requests to this domain to the windows server. Since cloudflare cannot to AXFR transfers to other DNS servers, I cannot configure windows server as a forwarding DNS and override certain subdomains to the local ones. It has to be done on pihole. Now, pihole has a public subdomain -> local subdomain CNAME, but without me explicitly adding the local subdomain to IP mapping, it just does not work. Meaning I need to maintain DNS records in two places, the windows server and Pi-hole. The DNS entries are added to the Windows server using external-dns over RFC 2136 dynamic DNS updates which the Pi-hole does not support (planning to add this as a new feature request too since Pi-hole can be a one stop replacement for all DNS servers).