Parse error: Unknown directive 'dns'

So I must be doing something wrong, or have missed something. Here’s my setup:

Download a caddy binary like so:

curl -fsSL https://getcaddy.com | bash -s git,cors,ipfilter,expires,cloudflare,dyn,googlecloud,route53

Here’s the Caddyfile (names changed to protect the innocent):

foo.bar.net {
  gzip
  root /var/www/bar.bar.net
}

tls {
  dns cloudflare
}

Here’s the output from caddy version and caddy list:

$ caddy --version
Caddy 0.9.3
$ caddy --plugins
Server types:
  http

Caddyfile loaders:
  short
  flag
  default

Other plugins:
  http.basicauth
  http.bind
  http.browse
  http.cors
  http.errors
  http.expires
  http.expvar
  http.ext
  http.fastcgi
  http.git
  http.gzip
  http.header
  http.internal
  http.ipfilter
  http.log
  http.markdown
  http.mime
  http.pprof
  http.proxy
  http.redir
  http.rewrite
  http.root
  http.status
  http.templates
  http.websocket
  shutdown
  startup
  tls
  tls.dns.cloudflare
  tls.dns.dyn
  tls.dns.googlecloud
  tls.dns.route53
  tls.storage.file

And here’s the error message:

2016/11/18 19:17:00 /etc/caddy/Caddyfile:9 - Parse error: Unknown directive 'dns'

Thoughts?

It thinks tls is a site address, because you haven’t put it in a site block. So it looks like dns is a directive.

That appears to be it. I misunderstood the docs, thought that the tls setting could be placed globally.

Thanks for the quick response.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.