How to add custom DNS resolver to Caddyfile

I’ve read here but could not figure out where to add a custom DNS resolver to my Caddyfile.

I want to use udp:// as DNS resolver.

My Caddyfile:

  order forward_proxy before file_server
:443, {
  forward_proxy {
    basic_auth user pass
  file_server {
    root /var/www/html

As far as I know isn’t this possible for global caddy instance but for the reverse_proxy as it is in the linked topic you mentioned.

Which module have forward_proxy directive as I can’t find it in the documentation Caddyfile Directives — Caddy Documentation . There is only mentioned the forward_auth (Caddyfile directive) — Caddy Documentation which is a opinionated wrapper over a reverse proxy as you can see here forward_auth (Caddyfile directive) — Caddy Documentation

The only way I see is to set the resolver in the system settings or add that feature to caddy :wink:

1 Like

Yeah, this is a feature request for the forward_proxy plugin. Open an issue on the github repo for that plugin.

1 Like

With forward_proxy you mean this one GitHub - caddyserver/forwardproxy: Forward proxy plugin for the Caddy web server ?