Score:0

How to configure CoreDNS to resolve CNAME records using foreign resolver

cn flag

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 record test IN CNAME test.r2.svc.
  • then ask the foreign resolver 10.11.12.13:53 for test.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.
Score:0
cn flag

I wrote plugin for CoreDNS to do it: https://github.com/kinjelom/coredns-recursor

enter image description here

Score:0
bw flag
dgj

I might be mistaken, but the forward r2.svc 10.11.12.13:53 is in the r1.svc block so it will never get called.

Client asks for test.r1.svc
Server responds that it's a CNAME for test.r2.svc
Client asks for test.r2.svc
Server doesn't know how to process the answer

Moving the forward r2.svc 10.11.12.13:53 line to the . block should allow it to process the second request.

kinjelom avatar
cn flag
Unfortunately it doesn't change anything
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.