title: Traefik : Auto-add subdomains to cloudflare DNS
body: <p>I use traefik as a reverse proxy for my self hosted services, and it works like a charm. Each time I add a new service, traefik detects it and routes queries accordingly. Each service is routed to a subdomain of my main domain.</p>
  
  <p>The only manual step I still have to do is to add a new record in the DNS for my new subdomain. And I would like to automate it.</p>
  
  <p>I know Cloudflare has an API for <a href="https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record" rel="nofollow noreferrer">managing DNS records</a>, and I can work it out from there. But I don't know if I can hook a script that would be triggered when traefik detects a new subdomain for example...</p>
  
  <p>Any pointers on where I could investigate on the traefik side to detect the event that a new subdomain was added ?</p>