Self-hosted DynDNS

2025/06/16

Roll your own free dynamic DNS (DynDNS) service with these simple steps:

  1. Host your DNS zone with a provider offering API access.
  2. Deploy a DynDNS script to a FaaS platform.

For Cloudflare, follow these instructions:

  1. Add your domain to Cloudflare.
  2. Set up your development environment.
  3. Deploy the DynDNS worker:
    • Obtain the worker script and run npm i.
    • Modify the domain in wrangler.jsonc.
    • Add subdomain tokens to src/tokens.json.
    • Execute wrangler deploy.

Verify operation with these commands:

# Sets the A/AAAA record to the IP address from the request.
curl https://dyndns.your.domain/your_token

# Explicitly sets the A/AAAA records.
curl https://dyndns.your.domain/your_token?ipv4=1.2.3.4&ipv6=::1

# Removes the A/AAAA records.
curl -XDELETE https://dyndns.your.domain/your_token

That’s all there is to it!