DuckDNS, a free name for a home IP that keeps changing

Networking

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

Your network has the public address 203.0.113.7, an updater run by cron every five minutes and a server on port 443. Step 1: the updater sends GET /update to the DuckDNS update API at www.duckdns.org, which writes the address into DuckDNS's nine authoritative name servers, ns1 to ns9. Step 2: a visitor's resolver asks the name servers for the A record of home-example. Step 3: they answer 203.0.113.7 with a 60-second TTL. Step 4: the visitor's browser connects straight to 203.0.113.7 port 443. DuckDNS only answers which address; the traffic never passes through it. A name that follows your address the updater reports the address · DNS hands it out · traffic goes direct Your network router · public IPv4 203.0.113.7 updater cron · every 5 min server port 443 forwarded DuckDNS update API www.duckdns.org HTTPS · token name servers ns1 … ns9 authoritative Visitor browser opens the name resolver caches it 60 s (TTL) 1 · GET /update ← OK 2 · A record? 3 · 203.0.113.7 4 · the browser connects to 203.0.113.7:443 directly DuckDNS only answers "which address?". Your traffic never passes through it.
The updater tells DuckDNS your current address; DuckDNS's name servers hand it to anyone who asks, with a 60-second TTL; the visitor then connects to your network directly.
Your network has the public address 203.0.113.7 and an updater run by cron every five minutes. Step 1: the updater sends GET /update to DuckDNS, whose update API writes the address into its authoritative name servers ns1 to ns9. Step 2: a visitor's resolver asks for the A record of home-example. Step 3: it gets 203.0.113.7 with a 60-second TTL. Step 4: the browser connects to 203.0.113.7 directly. DuckDNS only answers which address; the traffic never passes through it. A name that follows you updater reports · DNS answers · traffic direct Your network 203.0.113.7 updater: cron, every 5 min server: port 443 forwarded 1 · GET /update → OK DuckDNS update API at www.duckdns.org (HTTPS) name servers ns1 … ns9 (authoritative) home-example → 203.0.113.7 2 · A? 3 · TTL 60 s Visitor resolver caches the answer for 60 s browser opens home-example.duckdns.org 4 · the browser connects to 203.0.113.7 directly (dashed line) DuckDNS only answers "which address?". Your traffic never passes through it.
The updater tells DuckDNS your current address; DuckDNS's name servers hand it out with a 60-second TTL; the visitor connects to your network directly.

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:

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=
ParameterWhat it does
domainsRequired. Comma-separated subdomain names, without .duckdns.org: home-example,nas.
tokenRequired. The account token, a UUID shown on the account page. It authorises every subdomain on the account.
ipIPv4 (or IPv6) to store. Blank = DuckDNS uses the address the request came from. That auto-detection works for IPv4 only.
ipv6IPv6 to store in the AAAA record. Never detected. Sending it switches off IPv4 auto-detection, so send ip= explicitly too.
txtSets the subdomain’s single TXT value instead of the address (see below).
clear=trueEmpties the records (with txt: empties the TXT value).
verbose=trueReturns 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:

Timeline from 0 to 420 seconds after the ISP changes the address. Worst case: the updater ran just before the change, so for up to 300 seconds DuckDNS still serves the old address. At 300 seconds the updater runs and DuckDNS has the new address, but a resolver that cached the old answer just before keeps serving it for up to 60 more seconds. From 360 seconds everyone gets the new address. Worst case about 6 minutes; with the updater every minute, about 2 minutes. How long visitors can reach the old address worst case · updater every 5 min · TTL 60 s ISP changes the IP DuckDNS still holds the old IP · up to 300 s until cron fires cache ≤ 60 s new IP for all 0 s 60 120 180 240 300 360 420 Worst case ≈ 6 min (300 + 60 s). Run the updater every minute and it drops to ≈ 2 min (60 + 60 s).
The staleness window is the poll interval plus the TTL. The poll interval is the part you control.
Timeline from 0 to 420 seconds after the ISP changes the address. Worst case: for up to 300 seconds DuckDNS still serves the old address because the updater has not run; then resolvers may keep the cached old answer for up to 60 more seconds. From 360 seconds everyone gets the new address. Worst case about 6 minutes; with the updater every minute, about 2 minutes. How long the old IP lingers worst case · cron every 5 min · TTL 60 s IP changes at 0 s old IP at DuckDNS up to 300 s, until cron fires cache ≤ 60 s, then new IP 0 120 240 300 360 s Worst case ≈ 6 min (300 + 60 s). Updater every minute: ≈ 2 min. staleness = poll interval + TTL
The staleness window is the poll interval plus the TTL. The poll interval is the part you control.

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:

ClientHow it is set up
acme.shexport DuckDNS_Token=<your-token>, then acme.sh --issue --dns dns_duckdns -d home-example.duckdns.org
certbotthe certbot-dns-duckdns plugin: --authenticator dns-duckdns --dns-duckdns-token <your-token>
Caddybuild with caddy-dns/duckdns; tls { dns duckdns {env.DUCKDNS_API_TOKEN} }
lego / Traefikprovider 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

SituationWhy a name does not help
CGNATThe 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 forwardingThe name gets a visitor to your router. The router still has to forward the port to the server.
IPv6DuckDNS 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 DNSThe 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

OptionHow it differs
Your own domain + DNS provider APICloudflare, deSEC and most registrars have an API to rewrite one record (Cloudflare: PUT /zones/{zone}/dns_records/{id} 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.
dynv6Free; 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 serverThe 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

Questions? Let's Chat :)

application