0

Using CoreDNS 1.9.4 on Kubernetes 1.26.3

The following server block is used to resolve hosts within mydomain.cloud

    mydomain.cloud:53 {
      errors
      health
      file /etc/coredns/custom/db.mydomain.cloud
      cache 30
    }

The zone file db.mydomain.cloud looks like:

    $ORIGIN mydomain.cloud.
    @  3600 IN  SOA sns.dns.icann.org. noc.dns.icann.org. (
      2020080302 ; serial
      7200       ; refresh (2 hours)
      3600       ; retry (1 hour)
      1209600    ; expire (2 weeks)
      3600       ; minimum (1 hour)
    )
    *.aaa.mydomain.cloud   IN  A  172.21.129.11
    *.bbb.mydomain.cloud   IN  A  172.21.129.12
    *.ccc.mydomain.cloud   IN  A  172.21.129.13

Now, for a specific usage, the host names 01-external.mydomain.cloud and 02-external.mydomain.cloud are public and must be resolved using a public DNS server.

I have tried to add forward . 8.8.8.8 after the file plugin. But the name resolution for the hostname *external.mydomain.cloud above failed with NXDOMAIN error.

QUESTION: for a given zone like mydomain.cloud, is it possible to configure CoreDNS to use private custom file zone AND public DNS for a subset of hostnames within the zone? If yes, can you please suggest an example of config?

0 Answers0