Discussions

Ask a Question
Back to All

Kindly add to documentation coreDNS configuration that I provide here

Hello,

I have provided below a working configuration file that I have for coredns - a DNS server written in Go. I'd like to share it in hopes of increasing awareness about this amazing DNS server!

https://coredns.io/

https://github.com/coredns/coredns

:53 {
      	tls /root/core.pem /root/core-key.pem
        log
	errors
       	forward . tls://[IP address resolved by yourcode.dns.controld.com]:853 {
               	tls_servername [INSERT controld.com FQDN here i.e. yourcode.dns.controld.com]
				}
}

Save the above as a file named "Corefile" located in the same path/directory/folder as your coredns executable file.

You can get the IP address resolved by yourcode.dns.controld.com by doing either of the following:

  • Go to your ControlD web control panel -> Endpoints -> Resolvers button on the right of your target endpoint running coredns
  • Use mxtoolbox's supertool to perform a DNS Lookup against yourcode.dns.controld.com - https://mxtoolbox.com/supertool#
  • Use dig command in Linux against youcode.dns.controld.com to get the IP address

Here's how you can get your own .pem cert and .pem key files:

openssl req -newkey rsa:2048 -nodes -keyout core-key.pem -x509 -days 365 -out core.pem

Don't forget to set ownership of the .pem files using chown and setting them to read-only!

  • chown root:root core.pem core-key.pem
  • chmod 1500 core.pem core-key.pem

Likewise, you have to ensure that the path to your core-key.pem and core.pem files are the same as what is defined in the Corefile confguration file:

tls /root/core.pem /root/core-key.pem


May this be of great use to everyone!