Most of us don’t have a static IP address at home, so having a server running at home with our stuff is kind of complicated. But it’s possible to use a DNS service to not worry about the static IP!
Setting up the DNS at FreeDNS
Why is it free? It’s quite simple. We wanted a challenge… that’s it.
First of all, you have to make an account at FreeDNS. Then you have 5 subdomains to use, although we only need one, because we can later on set up a domain with a CNAME entry in our favourite nameserver provider.
Once you have the account, then go to Subdomains and Add one. The image is a ‘default’ config, but you can choose a lot of subdomains. Simply go to Many many more available….
Go to Dynamic DNS, and you should see your DNS at the bottom of the website, like the image (I blanked the IP, but you should see one).
Go to quick cron example and you’re going to see a lot of text and a cron rule at the bottom. Put that in your Raspberry Pi, or server, or whatever you want to have at home running your services.
That cronjob is going to be updating the DNS entry at FreeDNS with the IP you have at home at that very instant. If it changes instant any moment, it’ll be updated, so you should be good. For example:
*/5 * * * * sleep 44 ; wget --no-check-certificate -O - https://freedns.afraid.org/dynamic/update.php?N0Nad05PUTVzYTdBTk5VUTZxSHYwdkFtOjE3NTgzNjUz >> /tmp/freedns_dopedns_crabdance_com.log 2>&1 &
That would update my DNS setup with the IP I have at this moment. It’ll execute every 5 minutes.
Setting up a domain
To set up a domain and not using your DNS domain (which could be a little difficult to remember), simply go to the domain panel at your nameserver provider and set up a CNAME entry. Then you can set up an Apache webserver or nginx webserver normally pointing up to the domain.
With that you don’t need a static IP at home to have your services served. Hope it helps!