caddy-dynamicdns icon indicating copy to clipboard operation
caddy-dynamicdns copied to clipboard

Using multiple providers

Open kthchew opened this issue 2 years ago • 7 comments

Is it possible to use multiple providers to update different domains? I tried this config (simplified)

{
    dynamic_dns {
        provider cloudflare {$CLOUDFLARE_API_TOKEN}
        domains {
            main-domain.com
        }
    }

    dynamic_dns {
        provider duckdns {$DUCKDNS_TOKEN}
        domains {
            secondary-domain.com
        }
    }
}

but it seems like only the second dynamic_dns block (for DuckDNS) is functional; main-domain.com is not updated at all.

kthchew avatar Jul 14 '23 00:07 kthchew

I don't think it is possible right now unfortunately. It would require a restructure of the module config to handle that 😓

As a workaround you could run two instances of Caddy, one actually serving HTTP + ddns for one provider, and the other just taking care of ddns for the other provider with no site blocks.

francislavoie avatar Jul 14 '23 08:07 francislavoie

Huh, interesting. You want two domains from different providers pointed to your machine?

Haven't seen that need yet -- but if it's legitimate we can probably refactor some things.

mholt avatar Jul 14 '23 18:07 mholt

As a workaround you could run two instances of Caddy, one actually serving HTTP + ddns for one provider, and the other just taking care of ddns for the other provider with no site blocks.

Thanks for the workaround! That should work for me.

Huh, interesting. You want two domains from different providers pointed to your machine?

Haven't seen that need yet -- but if it's legitimate we can probably refactor some things.

To be honest, if it's too complicated then it may not be worth implementing. In my case, it's more of a temporary solution because I'm migrating my services to a new domain (and using a different provider), and this is meant to be a temporary thing until I can switch my users to the new domain, after which I'll only be using one provider. This isn't really meant to be a long-term setup in my case, so a temporary workaround like @francislavoie described works well for me.

kthchew avatar Jul 14 '23 19:07 kthchew

Awesome, good to know. Thanks!

I'll close this for now but we can revisit later if there's a more compelling use case for it.

mholt avatar Jul 14 '23 21:07 mholt

I also would like to see this option. I have multiple services running on my server. Some for my private network and some for my little company. That's why i need two domains.

maxbec avatar Aug 29 '24 17:08 maxbec

This might be a big change but if someone wants to discuss the changes and submit a PR, I'd be okay with reviewing/discussing it!

mholt avatar Aug 29 '24 17:08 mholt

I'm interested in this since I get asked often if its possible to implement this in the opnsense plugin. There seems to be a use-case for some caddy users.

I can not contribute it myself though.

Monviech avatar Dec 26 '24 09:12 Monviech