Skip to content

A simple Cloudflare Workers application to run a dynamic DNS service.

License

Notifications You must be signed in to change notification settings

kev-ac/cloudflare-worker-dynamic-dns

Repository files navigation

👷 cloudflare-worker-dynamic-dns

A small project to leverage the Cloudflare Workers and Cloudflare KV systems to provide a dynamic DNS service without the need to rely on third-party services.

Tested for use with AVM Fritz!Box. Should be compatible with most dynamic DNS setups.

Getting started

  1. Make sure to create the following secrets before publishing the worker to your account:
  • ZONE_ID - Your designated Cloudflare DNS zone
  • API_TOKEN - A Cloudflare API token with "Edit DNS zone" scope.
  1. Create a KV namespace and configure your wrangler.toml with the KV namespace ID and Account ID
  1. Create users in your KV namespace that can access the update endpoint with the following scheme:
  • subdomains:{YOUR_USERNAME}:token - ACCESSTOKEN of the user
  1. Start using the worker:
  • Send a GET request to {WORKER_URL}/update?ip={YOUR_DYNAMIC_IP} Basic Auth credentials in scheme {YOUR_USERNAME}: {ACCESSTOKEN}

Known issues

  • When a DNS record receives it's first update it takes a short time until the KV update is propagated through Cloudflare. As such it is possible that two different records will be created if IPs in consecutive requests don't match.

Improving the Worker

If you think that this worker should be improving please feel free to create an Issue or pull request with your proposed changes.

Examples

Configuration of a AVM Fritz!Box

Fritz!Box Screenshot

About

A simple Cloudflare Workers application to run a dynamic DNS service.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published