Raspberry Pi and DynamicDNS: How-to Access a Home Network From Anywhere
Accessing a Raspberry Pi (RPi) is a great capability to have (although this works for just about any computer as well). And since the device is low-powered, leaving it on all of the time is not such a problem. Once your RPi is tied to a domain name, the options are endless!
Requirements For This Walkthrough
- Internet connectivity
- Mac or PC
- DynDns.org Account with DynDNS Pro ($25/year) or Dyn Standard DNS ($29.95/year)–Alternatively, there are two free options: no-ip, and DNSdynamic, but your router would need to support these
- Registered Domain Name (or a free one from one of the aforementioned providers)
- Router that is DynDns-compatible (use DD-WRT if it is not)
- Ethernet cable(s) or Wi-Fi
DD-WRT firmware for your router if it does not support DynDns.org
Knowledge, Skills, and Abilities
- Ability to navigate throughout a computer OS
- Knowledge of basic computer terminology
- Knowledge of IP addresses
- Knowledge of the Domain Name System (DNS)
- Ability to log into a home router via IP address and forward ports to a device on the network
Creating A DynDns.org Account
Let’s say you own a domain name, such as myhomenetwork.net (this was not a real domain when I made this). If you want to connect to that domain over the Internet, it needs an IP address. However, since most home users have an IP address that is constantly changing, a service is required to update the domain name with its constantly-changing IP address. That is where DynDns.org comes in.
Their paid service allows your home router to tell the Internet when your IP address changes so anytime you want to get to myhomenetwork.net, it will always be pointing to the right IP address. This allows you to do many things on your home computer (or in this case, the Raspberry Pi) including running a Website, running an OpenVPN server, or even running a live-steam Webcam.
Choose A DynDns.org Service Level
Best Service Levels for Home Users
This service allows you to choose from a large list of pre-selected domains and assign them to your home IP address. This is a nice package if you don’t want to deal with the complexity of DNS, just select a domain name, connect it to your router and you are set.
While a nice deal, I think it worth the $5 extra dollars to be able to pick your own domain name and get more advanced features with the Standard level (described below).
Dyn Standard DNS
The Standard package allows you to pick any domain name, not just the ones they offer (you will have to buy it, however). It also gives you the ability to add CNAME records (aliases that point to a certain area) and MX records (for running a mail server), among many other advanced features. If you have experience with DNS, this is probably a better level for you.
Connect DynDns.org to Your Home Router
Whichever package you choose, the setup for your home router will be the same:
1. Log into your router via a Web browser
2. Search for an option called Dynamic DNS
3. Enter your DynDns.org account information
4. Click Save
If it did not work, just wait for a while. It might take some time for DNS to propagate and your account to become fully-active.
Deciding What To Do With Your Raspberry Pi, Now That it is Accessible Over the Internet
If you were to go to myhomenetwork.net (again, this is just an example and not a real domain) after adjusting these settings, nothing would happen because the router only knows that myhomenetwork.net points to your dynamic IP address. It doesn’t know about any services being offered or where to find them.
The next task would be to decide what services to run on the Raspberry Pi and then forward the appropriate port to it.