tiredofit / docker-traefik-cloudflare-companion

Automatically Create CNAME records for containers served by Traefik

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

domain-specific TARGET_DOMAIN?

jo-me opened this issue · comments

I have two zones in Cloudflare, so 2 domains and separate DNS settings.
In traefik I specify dedicated subdomains for each domain.

cfcompanion's config allows to specifiy several domains DOMAIN1, DOMAIN2...
However, the TARGET_DOMAIN seems to be used for all domains specified.
All CNAME records are created in that TARGET_DOMAIN.

So in my domain1.com DNS settings I get

CNAME    mysubdomain.domain2.com       domain1.com
CNAME    othersubdomain                domain1.com

Instead of one CNAME in domain1.com and the other in domain2.com

Bug ? Or am I not getting something?

My workaround is to create two containers - one for each domain/zone

I'd have to think about this but it would likely involve a massive rewrite of the code. I myself have a similar solution with 9 zone's. How I solve it is by creating a A record to the hostname of the server itself.

I think I managed to implement this in #30. Can someone else test it as well and see that I didn't make a stupid mistake.

It seem to work fine for me at least, using it right now together with the changes from #15.

This should be fixed now that #30 is merged

Tagged as tiredofit/traefik-cloudflare-companion:6.2.0 - Many thanks @mbjurstrom