I am looking for an example configuration in which CoreDNS will read the CNAME record from the file (file plugin) and then resolve it using a custom resolver (forward plugin?). A client should not get CNAME record but only A records.
For example:
- if the client ask the CoreDNS for
test.r1.svc
- then the CoreDNS get the
CNAME
recordtest IN CNAME test.r2.svc.
- then ask the foreign resolver
10.11.12.13:53
fortest.r2.svc
- and response to the client with the
A
records
Is it possible?
This config is not working for me:
Corefile
# root
. {
log
errors
}
r1.svc {
file r1.svc
forward r2.svc 10.11.12.13:53
log
errors
}
r1.svc
file
$ORIGIN r1.svc.
@ 3600 IN SOA sns.dns.icann.org. noc.dns.icann.org. (
202211241713 ; serial
7200 ; refresh (2 hours)
3600 ; retry (1 hour)
1209600 ; expire (2 weeks)
3600 ; minimum (1 hour)
)
3600 IN NS a.iana-servers.net.
3600 IN NS b.iana-servers.net.
test IN CNAME test.r2.svc.