Cloudflare DNS Sync

Hi folks,
I’ve a built a bit of code that syncs your private Tailscale IPs to a cloudflare hosted DNS zone.
The main benefit over MagicDNS + Certificate Beta is that you can use your own domain + certbot.
Also, you are not dependent on a being connected to Tailscale for DNS resolution (eg. behind a subnet router)



Nice script. Great work. How hard would it be to add a postfix to each domain with this? For example, I have a domain I use for homelab stuff and all Tailscale sub-domains are postfixed with -ts. I do this because I use ZeroTier and/or CloudFlare tunnels for various services in addition to Tailscale depending on what it is and how I use it. I have it setup so its standardized as -ts, -zt, or -cf after each domain so its easy to remember. For example,,, and



Hi, thanks for your feedback.
Shouldn’t be that hard. I’ll try to add it this weekend.

Hi, just added the feature.
Pull the lastest version and add prefix=xyz and/or postfix=xyz to the config file or docker env.


1 Like

Works great. Thanks for the update. Here’s my working docker compose entry:

    container_name: tsdns
    restart: unless-stopped
      - cf-key=${CFKEY}
      - cf-domain=${CFDOMAIN}
      - ts-key=${TSKEY}
      - ts-tailnet=${TSTAILNET}
      - postfix=-ts

All environment variables are located in a .env file. Did find out quickly they are case sensitive. I originally entered as all caps, since that’s what I was used to (mainly linuxserver containers), but not a big deal.

can it used on synology?