There are plenty of providers for this service, but I use FreeDNS, which provides this service for free for some hosts (5 as of today). Another reason to use this service is that it does not need your account credentials for updates.
- Go to the FreeDNS pricing page, and select an account type, starter is free.
- Fill in the blanks, confirm your email address, …
- Got the the FreeDNS subdomain page, login.
- Click Add a subdomain
- Fill the form
- Type : A
- subdomain : mysuperhostname
- domain : mooo.com (or whichever you want)
- destination : should be automatically filled with your current external IP address
- Wildcard : not checked
- Fill the captcha.
- Now the subdomain page should show mysuperhostname.mooo.com.
- Go the the Dynamic DNS page.
There are plenty of DDNS clients for ubuntu, but the quick cron example will just work fine.
- Click on cron example
- Copy the file and add it to your cron (see how)
- Since the default
wget(from busybox) does not support https, the full
wgetand the certificates must be installed:
opkg update opkg install opkg install wget ca-certificates
- If you’re using the web interface (
opkg install opkg install luci-app-ddns
- Or without web interface support:
opkg install opkg install ddns-scripts
- edit the file
- restart the service
The IP should be shown almost immediately on the subdomain page. DNS propagation could be a little bit long (3600 seconds caching for free accounts), and this can be verified using dig:
dig +short mysuperhostname.mooo.com 23.75.345.200
DNS and caching
DNS answers can (and will) be cached by the DNS server, and a change in name resolution will take some time to propagate. The duration of the validity for a name resolution is included in the response, it’s the TTL (time-to-live).
The time to live will be a fixed value when asking the authoritative name server, for instance 60 seconds:
dig +nocmd +noall +answer mysuperhostname.mooo.com @ns1.afraid.org mysuperhostname.mooo.com. 60 IN A 23.75.345.200
Or a value that decrement when asking another server:
dig +nocmd +noall +answer mysuperhostname.mooo.com mysuperhostname.mooo.com. 26 IN A 23.75.345.200
Some providers does not follow the rules and may cache DNS entries longer.
The update need a shared secret, in this example
This one is completly fake, but the real one can be found on the
Dynamic DNS page, then by
looking in the quick cron sample or at the direct url.
echo 'd2VsY29tZSB0byBodHRwczovL2NsaS5waWduYXQub3JnDQo=' | base64 -d