Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
U

unifi-ddns

> 编程语言
Open source

Cloudflare DDNS (Dynamic DNS) support for UniFi OS

1.3K stars0 likes0 views
WebsiteGitHub

About

Cloudflare DDNS (Dynamic DNS) support for UniFi OS

️ Cloudflare DDNS for UniFi OS

A Cloudflare Worker script that enables UniFi devices (e.g., UDM-Pro, USG) to dynamically update DNS A/AAAA records on Cloudflare.

Why Use This?

Note: UniFi Network Application 9.1.92+ includes native Cloudflare DDNS support. If your gateway runs this firmware or newer, you may not need this worker. However, the native implementation does not support multi-hostname updates, dual-stack (IPv4 + IPv6), or preserving proxy status — this worker remains useful for those use cases and for older firmware.

UniFi devices running older firmware do not natively support Cloudflare as a DDNS provider. This script bridges that gap, allowing your UniFi device to keep your DNS records updated with your public IP address.

Setup Overview

1. Deploy the Cloudflare Worker

Option 1: Click to Deploy

  1. Click the button above.
  2. Complete the deployment.
  3. Note the *.workers.dev route.

Option 2: Deploy with Wrangler CLI

  1. Clone this repository.
  2. Install Wrangler CLI.
  3. Run:
    bash
    npm i
    wrangler login
    wrangler deploy
  4. Note the *.workers.dev route.

2. Generate a Cloudflare API Token

  1. Go to the Cloudflare Dashboard.
  2. Navigate to Profile > API Tokens
  3. Create a token using the Edit zone DNS template.
  4. Scope the token to one specific zone.
  5. Save the token securely.

3. Configure UniFi OS

  1. Log in to your UniFi OS Controller.
  2. Go to Settings > Internet > WAN > Dynamic DNS.
  3. Create New Dynamic DNS with the following information:
    • Service: custom
    • Hostname: subdomain.example.com or example.com
    • Username: Cloudflare Account Email Address (e.g., [email protected])
    • Password: Cloudflare User API Token (not an Account API Token)
    • Server: ..workers.dev/update?ip=%i&hostname=%h (Omit https://)

️ Testing & Troubleshooting

Using this script with various Ubiquiti devices and different UniFi software versions can introduce unique challenges. If you encounter issues, start by checking the FAQ in /docs/faq.md. If you don’t find a solution, you can ask a question on the discussions page. If the problem persists, please raise an issue here.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptcloudflarecloudflare-workersddnsddns-updater

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言