LAN DNS: CNAME targets should resolve against local LAN DNS records
I have a local Linux server that has a fixed IP address. The server runs Kubernetes so hosts a number of applications like grafana, photoprism, gitlab, wordpress, etc.
In Local DNS I add an A record for the Linux server. Then for all the services hosted on Kubernetes I setup a CNAME record to point to the A record. However, instead of returning the local ip address, the CNAME returns the public IP address as defined in global DNS (in my case setup at DnsExit).
I find this *very* surprising. My expectation is that the CNAME should return the local IP address.
To reproduce in Omada web interface (Network Config -> LAN -> Local DNS):
1. Create an IP rule: cumulus.example.lan → 192.168.30.3.
2. Create a CNAME rule: grafana.example.lan → cumulus.example.lan.
3. Query the gateway directly, with no other DNS server involved:
$ dig @192.168.30.1 cumulus.example.lan
cumulus.example.lan. 3600 IN A 192.168.30.3 <- correct, from the IP rule
$ dig @192.168.30.1 grafana.example.lan
grafana.example.lan. 3600 IN CNAME cumulus.example.lan.
cumulus.example.lan. 3600 IN A 73.x.x.x <- public address, from upstream DNS
Expected: When following a CNAME, the gateway should look up the target in its own LAN DNS rules first and fall back to upstream only if there's no local match, as standard DNS resolvers do. That's the main reason to use a CNAME on a LAN: many service names pointing at one internal host.
The current behavior makes LAN DNS CNAMEs unusable for split-horizon DNS. The usual setup is a server with a public address that should be reached by its internal address from inside. The only workaround is a separate IP rule for every name, which makes CNAMEs useless. Or aliases can be used as another workaround, but are limited to 6 per rule, so not great.
My request is this behavior should be changed to resolve CNAME targets against local LAN DNS rules before forwarding upstream.
