Dynamic DNS using freedns.afraid.org

by on March 6, 2017

If you’re like me and have a computer running at home and don’t have the luxury of a static IP address, you’re probably already using a dynamic DNS service. In a nutshell, a dynamic DNS service provides you with an easy to remember hostname in the form of hostname.domain.com. This is much more convenient than trying to remember a numeric IP address. There are plenty of services and guides online. For more information you can check out this guide from noip.com.

I had been using dyndns.org for a long time until they canceled their free service. That’s when I switched to noip.com‘s free service which works fine except for the annoying monthly emails asking me to confirm my hostname.  I recently discovered freedns.afraid.org. They have a free dynamic DNS service which is quite extraordinary.

“Why is it free? It’s quite simple. We wanted a challenge… that’s it.” freedns.afraid.org

In the following part, I explain how to get your own hostname from freedns.afraid.org and configure your computer to update your IP address.

Step 1: Create your FreeDNS hostname

Go to freedns.afraid.org and create an account. Don’t forget to activate your account by following the instructions in the welcome email. This is the only time you have to confirm something. Quite a change from the monthly emails asking you to confirm your hostname as is common with other dynamic DNS services.

Now it’s time to choose your hostname by clicking on subdomains:

FreeDNS.afraid.org subdomain registration.

You can choose the name of your subdomain and pick your domain out of thousands of domains provided by users of FreeDNS.

Step 2: Updating your IP address

FreeDNS needs to know to which IP address your hostname should point. Your current IP address is automatically linked to the hostname you chose earlier. Try it out! It should work after a few minutes. Your IP address might however change at any time whenever your internet provider feels like it. Instead of manually updating the IP address at freedns.afraid.org you can setup automated updates using your server or your router.

I was originally planning on using ddclient on my Ubuntu server to update my IP address when I ran into some problems trying to configure it. It seems like ddclient used to support FreeDNS in the past but not anymore. (Update: ddclient now supports FreeDNS. Thank you hexadec!) It is not listed under the supported protocols. Instead I’m going to use a cron job using the template provided by FreeDNS. To install the cron job, simply run crontab -e on your linux (or mac) server, and then copy the generated cron script. Here an example:

# Cron example for somehostname.somedomain.com - will update in 5 minute intervals.
# Works for mac, linux (or any OS with a cron scheduler)

# If you're not familiar with the cron scheduler, you can search for "install a cron", cron is the standard scheduler available on most non-windows systems, macs, routers, NAS boxes and so on
# Using IPv4 transport

# Test on the console using ..:
# curl http://sync.afraid.org/u/randomizedtoken/

# To install into cron, on the console enter: crontab -e
# Then paste in the 2 lines at the bottom of this page, and save
# You can check the "/tmp/freedns_somehostname_somedomain_com.log" file on your system to verify that it happens every 5 minutes

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
2,7,12,17,22,27,32,37,42,47,52,57 * * * * sleep 13 ; curl -s http://sync.afraid.org/u/randomizedtoken/ >> /tmp/freedns_somehostname_somedomain_com.log 2>/dev/null

If your are on windows or would like to use your router to handle the updates, check the FreeDNS FAQ.

Comments

Good article, although it has a few typos that make it look a bit less professional than it could.
Also, you might want to try http://freemyip.com. It’s a free DDNS service that doesn’t even require creating an account, so it’s even easier and quicker to use than Freedns.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.