TechnitiumSoftware / DnsServer

Technitium DNS Server
https://technitium.com/dns/
GNU General Public License v3.0
4.2k stars 413 forks source link

Cannot add CNAME record with name @ #1013

Open fogyismstar opened 3 weeks ago

fogyismstar commented 3 weeks ago

Cannot add CNAME record with name @ 截图_选择区域_20240829090147

ShreyasZare commented 3 weeks ago

Thanks for asking. DNS protocol does not allow having CNAME at the zone's apex. This is since CNAME record cannot exists with any other record type for the same domain name whereas your zone's apex already has SOA and NS records.

If you get a DNS server to add CNAME at zone's apex and when a client caches this CNAME record, all of the records at your zone's apex like SOA, NS, MX, TXT which are commonly present, will fail to resolve.

hatchmt commented 2 weeks ago

It's possible that the intent of this request was to see behavior similar to Cloudflare's CNAME flattening on the apex:

https://developers.cloudflare.com/dns/cname-flattening/

Other providers offer similar functionality (ie: AWS Route53's ALIAS type records), where the DNS server looks up the CNAME and returns an A record as the answer. It would be a nice option to have, not just for the apex record but for other records (on a one-off basis or globally as an option) as there are potential performance gains. CF mentions that flattening can reduce the number of client lookups on names with many levels of CNAME (would need to disable it on individual records where CNAME response is expected).

ShreyasZare commented 2 weeks ago

Ya, could be that OP was looking for such function. In that case, there is ANAME record available that does CNAME Flattening.

hatchmt commented 2 weeks ago

Heh - I should read the docs. Didn’t realize ANAME had already been implemented. 😂