DuckDNS, a free name for a home IP that keeps changing
DuckDNS gives you a name like home-example.duckdns.org and lets you change the address it points to with a single HTTPS request. That is the whole service. It exists for one situation: a server at home — a Home Assistant box, a NAS, a VPN endpoint — behind an internet connection whose public IPv4 address the ISP changes from time to time. A name that you rewrite whenever the address moves is called dynamic DNS; DuckDNS is a free, donation-funded provider of it, hosted on AWS.
It is deliberately small: no choice of record types, no zone editor. You get an A record, an AAAA record and one TXT record per subdomain, an update URL, and a token.
Why the address moves
A home connection’s public IPv4 address is leased, not owned. The ISP hands it out over DHCP for a finite lease (RFC 2131) or with each PPPoE login, and a router reboot, a line resync or a forced daily reconnect can bring back a different one. Anything that reached your server by number — a bookmark, a VPN profile, a phone app — now points at someone else’s line.
DNS is the usual fix for “the number changes, the name should not”, but ordinary DNS hosting assumes records change rarely and by hand. Dynamic DNS adds two things: a record with a short TTL, so resolvers do not cache the old address for long, and an update API a small program on your network can call the moment it sees a new address.
How a request finds your server
The zone is served by nine name servers, ns1.duckdns.org to ns9.duckdns.org, all on AWS addresses; the web front end is an AWS load balancer in ca-central-1. A subdomain’s records come back with a TTL of 60 seconds. Two behaviours are worth knowing, both visible with dig against ns1.duckdns.org:
- Every name below your subdomain answers too.
x.y.home-example.duckdns.orgreturns the same A record ashome-example.duckdns.org, so a reverse proxy can routenas.home-example.duckdns.organdha.home-example.duckdns.orgwithout any extra records. - A name nobody registered is
NXDOMAIN, and that negative answer is cached for 600 seconds (the SOA minimum).
The update API
One GET, over HTTPS, with the token in the query string:
https://www.duckdns.org/update?domains=home-example&token=<your-token>&ip=
| Parameter | What it does |
|---|---|
domains | Required. Comma-separated subdomain names, without .duckdns.org: home-example,nas. |
token | Required. The account token, a UUID shown on the account page. It authorises every subdomain on the account. |
ip | IPv4 (or IPv6) to store. Blank = DuckDNS uses the address the request came from. That auto-detection works for IPv4 only. |
ipv6 | IPv6 to store in the AAAA record. Never detected. Sending it switches off IPv4 auto-detection, so send ip= explicitly too. |
txt | Sets the subdomain’s single TXT value instead of the address (see below). |
clear=true | Empties the records (with txt: empties the TXT value). |
verbose=true | Returns detail instead of a bare OK. |
The answer is two letters: OK, or KO for a wrong token or a subdomain not on that account. With verbose=true, a success is OK followed by three lines — the stored IPv4, the stored IPv6 (either can be blank) and UPDATED or NOCHANGE:
OK
203.0.113.7
NOCHANGE
NOCHANGE matters: the update is idempotent, so a client can send the same request every few minutes without tracking state. Older routers that cannot build a query string can use a path form, one subdomain only — https://www.duckdns.org/update/home-example/<your-token> — and routers that only speak the old DynDNS protocol can use https://nouser:<your-token>@www.duckdns.org/nic/update?hostname=home-example&myip=…, which answers good, nochg or bad like the DynDNS2 API it imitates.
The updater, and how stale the name can get
DuckDNS’s own install page gives a two-line Linux updater: a script that pipes the URL into curl, and a cron line that runs it every five minutes.
# ~/duckdns/duck.sh
echo url="https://www.duckdns.org/update?domains=home-example&token=<your-token>&ip=" | curl -s -o ~/duckdns/duck.log -K -
*/5 * * * * ~/duckdns/duck.sh >/dev/null 2>&1
Two details. Passing the URL through -K - (read options from stdin) keeps the token out of ps output, where any local user could read a command line. And the official version of the script adds -k, which turns off certificate checking: anyone able to intercept the request would get the token. Drop the -k; the API has a valid certificate.
With a five-minute poll and a 60-second TTL, a change of address is not seen everywhere at once:
A router that runs the update itself on every reconnect (most have a dynamic-DNS page; on a FRITZ!Box it is a “user-defined” provider with an update URL) closes the first part of that window to a few seconds, because it knows the moment its WAN address changes. A cron poll only finds out at its next run.
TXT records and Let’s Encrypt
Each subdomain also carries one TXT value, set with the same endpoint:
https://www.duckdns.org/update?domains=home-example&token=<your-token>&txt=<value>&verbose=true
It does not show in the web interface, and like the A record it is answered for every name below the subdomain. That is exactly what Let’s Encrypt’s DNS-01 challenge needs: to prove you control home-example.duckdns.org, you publish a token at _acme-challenge.home-example.duckdns.org, which DuckDNS serves from the subdomain’s TXT value. DNS-01 is the only challenge type that can issue a wildcard certificate (*.home-example.duckdns.org), and unlike HTTP-01 it needs no inbound port 80 — useful when the ISP blocks it (Let’s Encrypt challenge types).
Every common ACME client has a DuckDNS plugin, all driven by the same token:
| Client | How it is set up |
|---|---|
| acme.sh | export DuckDNS_, then acme.sh --issue --dns dns_duckdns -d home-example.duckdns.org |
| certbot | the certbot- plugin: --authenticator dns-duckdns --dns-duckdns-token <your-token> |
| Caddy | build with caddy-dns/; tls { dns duckdns {env. |
| lego / Traefik | provider duckdns, env DUCKDNS_TOKEN |
The catch is the word one. Every name below the subdomain shares that single TXT value, so an order for two names — home-example.duckdns.org and *.home-example.duckdns.org, or nas.home-example.duckdns.org and ha.home-example.duckdns.org — needs two different tokens visible at the same time, and DuckDNS can show only one: the second write overwrites the first and one validation fails. One name per order. The reliable route is a wildcard-only certificate — *.home-example.duckdns.org covers nas.home-example.duckdns.org but not the bare name — or one certificate per name, issued one after the other.
Rate limits are kinder than they look. duckdns.org is on the Public Suffix List (private section), so for Let’s Encrypt each home-example.duckdns.org counts as its own registered domain with its own 50-certificates-per-week bucket, instead of every DuckDNS user sharing one (rate limits). The same listing makes browsers treat each subdomain as a separate site for cookies.
What dynamic DNS cannot fix
| Situation | Why a name does not help |
|---|---|
| CGNAT | The ISP puts many customers behind one shared IPv4 address. Your router’s WAN address is then private, often in the shared range 100.64.x.x–100.127.x.x set aside for exactly this (RFC 6598). DuckDNS will happily record the shared public address, but inbound connections to it land at the ISP, not you. Check: if the router’s WAN address differs from what a “what is my IP” site shows, you are behind CGNAT or a second NAT. |
| No port forwarding | The name gets a visitor to your router. The router still has to forward the port to the server. |
| IPv6 | DuckDNS cannot detect it (its load balancer does not accept IPv6), so the updater must send ipv6= — and then ip= as well, because an explicit ipv6 turns IPv4 detection off. And an IPv6 address belongs to one host, not the router: the updater must run on the server, or send the server’s address. |
| Reverse DNS | The PTR record for your address lives in the ISP’s zone; DuckDNS cannot set it. A mail server needs it. |
Behind CGNAT the usual answers are IPv6 (no NAT at all), a tunnel that your server dials out on (WireGuard to a small VPS, or a hosted tunnel), or asking the ISP for a public IPv4.
The token is the account
There is no password per subdomain and no scope on the token: whoever has it can repoint every subdomain on the account, or set a TXT value and get a certificate for your name. It sits in a query string, so it ends up in router configs, shell history and any proxy log in the path. Keep it in one place, never in a screenshot or a public repository, and use the “recreate token” button on the account page the moment it leaks — the old one stops working.
The service itself is a second dependency. It is run by two engineers and funded by donations, and it has had multi-day resolution failures reported by users, for example in November 2024 on the Home Assistant forum. Fine for a home lab; for anything with users, a domain you own is worth the few euros a year.
Alternatives
| Option | How it differs |
|---|---|
| Your own domain + DNS provider API | Cloudflare, deSEC and most registrars have an API to rewrite one record (Cloudflare: PUT /zones/ with a scoped token). Your name, a token limited to one zone, multiple TXT values. |
deSEC (dedyn.io) | Free, non-profit, DNSSEC-signed; DynDNS2-style updates at update.dedyn.io, rate-limited to 2 updates per 2 min per domain. |
| dynv6 | Free; updates IPv4, IPv6 and a whole IPv6 prefix in one call. |
| FreeDNS (afraid.org) | Free subdomains of many shared domains; token update URLs. |
| No-IP (free tier) | DynDNS2 protocol; a free hostname must be confirmed every 30 days or it is deleted; no TXT records. |
| RFC 2136 on your own server | The standard: nsupdate sends a signed DNS UPDATE message (RFC 2136, authenticated with TSIG, RFC 8945) to a name server you run. |
Generic clients cover most of these at once: ddclient and inadyn both speak DuckDNS, DynDNS2, Cloudflare and nsupdate, so switching provider is a config change, not a new script.
The short version
- DuckDNS = a free
*.duckdns.orgsubdomain with an A, an AAAA and one TXT record, rewritten by one HTTPS GET with your token. ip=blank → DuckDNS takes the request’s source IPv4; IPv6 is never detected, sendipv6=.- Answers carry a 60 s TTL; with a cron updater every 5 min the name can be up to ≈ 6 min stale.
- Every name below your subdomain resolves the same, so one record serves many reverse-proxied services.
- DNS-01 via the TXT record gives Let’s Encrypt certificates, wildcards included — but only one TXT value at a time, so one name per order (a wildcard-only certificate, or one certificate per name).
- It cannot get you through CGNAT, forward a port or set reverse DNS.
- The token controls every subdomain on the account: keep it out of logs and drop the
-kfrom the official script.