coredns.io
coredns.io copied to clipboard
Add flatten external plugin
Adding a new external plugin that implements a form of CNAME flattening that is compatible with apex records.
It is notably different from rewrite
as it only changes the response for A and AAAA records. Allowing other records such as SOA, MX, TXT etc. to be served as intended.
Implemented by checking the request NAME as a match for the parameter and that the QType is A or AAAA. Then resolves to the selected DNS Server, creates a reply and overwrites the rr header to provide the original requested NAME for RFC compliance. All other requests fall through to the next plugin.