Consul on Kubernetes: website CoreDNS integration gives error

When following the CoreDNS section of the documentation to bridge Kubernetes and Consul DNS, you are prompted to add a piece of configuration to CoreDNS config:

    consul {
      errors
      cache 30
      proxy . <consul-dns service cluster ip>
    }

Unfortunately when running the coredns pod with this configuration an error shows up:

/etc/coredns/Corefile:20 - Error during parsing: Unknown directive 'proxy'

It seems either a bug in the documentation or is missing a critical piece of information. (Do someone know who to report website bugs?)

From my understanding, proxy is an external CoreDNS plugin, and is disabled by default, so in the coredns/coredns docker image is not present. It took me a while to understand that.

I was able to make it work by replacing proxy with forward, but I’m not sure what are all the implications of this.

You may also enable the plugin (plugin are enabled at compile time in CoreDNS), build the executable and push a new docker image for it.

Hi @endorama,

What did your config look like?

Here is an example config that I have in a demo repo:

Maybe comparing against it can get it working for you.

I’m not very familiar with coredns, but I did not explicitly enable a proxy plugin.

Best,

Freddy

Try forward instead of proxy, forward is the new one. (https://github.com/coredns/coredns/tree/master/plugin/forward#examples)