Last Updated on July 9, 2023 by Thiago Crepaldi
DuckDNS is a simple and free Dynamic DNS (aka DDNS) service that is supported as a custom configuration on your Unifi Dream Router (aka UDR), but still very stable and easy to get it running with the right steps. Although I have mentioned this tutorial is meant for the Unifi dream Router, it should also work for Unifi Dream Machine Pro/SE Edition too, with small UI differences.
Go to duckdns.org and sign-up using one of the many supported authentication methods. In particular, I find it very handy to use GitHub or Google accounts for this purpose. Once you are logged in, take note of your account and token to use on pfSense configuration later. Finally, at the Domains section, add a sub domain and click on Add domain. If the name is available, you will get a notification and from that moment own, yoursubdomain.duckdns.org is yours!
Now that you have a sub-domain, account and token from duckdns.org, on your UDR, go to Applications >> Network >> Settings >> Internet page. Click on your WAN interface, scroll down until you find Dynamic DNS section and finally click at Create New Dynamic DNS button and fill in the form as follows:
- Service: sitesolutions
- Hostname: yoursubmodomain.duckdns.org
- Username: nouser
- Password: nopassword
- Server: www.duckdns.org/update?domains=%h&token=YOURTOKEN
Click on Save. If you entered all correct information, right after saving, your public IP must be sent to duckdns.org servers. Go to your duckdns.org account and check it out. That is it!
You thing that you may have noticed is that Unifi does not allow you to set an interval update time… But rest assured, UDR does everything under the hood for you!
OPTIONAL: Redirect DuckDNS URL to your Domain’s
Although it is good enough to have subdomain.duckdns.org returning your router’s public IP, it is even cooler to have ddns.mydomain.com pointing to your router!
In order to do so, all you have to do is to create a CNAME record on your DNS provider. Type ddns or whatever name you prefer as subdomain and as use your full DuckDNS URL as the Target/Content (e.g. mysubdomain.duckdns.org). TTL can be as short as 15 min. If you are using Cloudflare, change Proxy type to DNS only. After creating this entry, it should take a couple minutes until ddns.mydomain.com starts redirecting to mysubdomain.duckdns.org which will point to your UDR’s public IP in turn. Pretty cool, huh?