Background
A family member wants to have access to devices on their home network from the internet, and have been using the public IP-address given by the ISP to connect back home.
Unfortunately, during certain events, such as power outages, the ISP has a short enough lease that a new IP-address is given.
When this happens, the family member can no longer connect to their home network until they have manually changed the IP-address to the new one in the applications they use.
It would be adventageous for them to avoid this “debacle” of the things not working and the digging up of the new/current IP-address.
It would also be a bonus if the family member can monitor whatever solution is implemented, for their own sake.
Research and Resources
DNS and DDNS
DNS is the way to abstract away IP-addresses, and DDNS (Dynamic DNS) is the way to keep periodically changing IP-addresses current in a DNS registrar. What is DDNS? Wipikedia summarizes it adequately:
Dynamic DNS (DDNS) is a method of automatically updating (IP-addresses in*) a name server in the Domain Name System (DNS), often in real time…
*DDNS can update more than just IP-addresses, but that is what is relevant for this article.
DDNS requires a service to run within the target/local home network on something. This something can be anything from the ISP-provided router, smart home hub, personal computer/device, maybe even the fridge these days, as long as it has internet access and can run some user specified code periodically. The actual piece of code that has to run depends on what the DDNS provider requires, as no established standard exists. However, for the most part, DDNS providers either have an API or a HTTP/HTTPS based protocol (or both) for updating the registrar.
Since I am not looking to do anything fancy with DDNS, I am choosing the path of a HTTP/HTTPS based protocol. Primarily because it is dead simple; a single HTTP/HTTPS request, and Bob’s your uncle.
And since this is a home project; costs (especially monthly/anually ones) should be minimized, so a free DDNS platform is highly preferred.
I settled on these two DDNS providers:
For these reasons:
- Free (for this type of use)
- Supports updating via HTTPS request
- Community made container for Duck DNS. More on this later
- Signup with GitHub (one less set of credentials to keep track of)
Support structure
With this device being far away, being able to just zip over and just do something real quick is not an option. We are talking ~24hour round trip. Therefore, some kind of support structure has to be in place. In this case I am defining support structure as (most-to-least important):
- Establishing a remote connection for basic tools, such as ssh and scp
- Having functionality that separates device management from applications
- Being able to update and roll back software versions
- Management for multiple devices
I could set this all up using existing open source tools and software, however, the part about the family member wanting to monitor the implementation falls up this alley. ssh is not really user friendly for someone that is not good with computers, so I’m getting pulled towards some kind of all-in-one IoT platform here.
Fortunately, or more like unfortunately, I have had the pleasure of working with some of there platforms in my career.
The one I ended up choosing for this project is not one I endorse, but I can not really say I disprove of it either; balena.io
It has all the bells and whistles I could ask for, but most importantly: it is free (for this kind of use)
Device
I could use an existing device on the local home network. I chose not to for these reasons:
- Whatever existing device I may choose can (read will) be replaced at some point beyond my control, and probably without warning
- Existing devices on their network are still their devices. Which does not let me do whatever I want on them and they can do whatever they want with them (ex. shut it down, factory reset)
- If anything happened to the existing device, anything, it “would be my fault” and I would have to get involved
So I am looking for a device to add to their network. Said device should therefore match these criterias:
- Inexpensive or disposable/consumable
- Available and off-the-shelf
- Reliable (read: tested and supported)
- Able to run a simple service/application
- Compatible with the support structure (balena.io)
And the winner is, to my great dismay, a Raspberry Pi… ugh
Don’t get me wrong, they are useful for what they are, I just don’t like them. In fact, I really don’t like them, and I will give you some heavily biased reasons why:
- They started out as toys (a way to learn computers), and they are still toys today, just more vetted
- They get used in professional products, because entry level engineers think they are great / used them in school
- They are the bog standard for computing device to throw at any home project with a low budget (exactly like this one)
- There really is no other competitor that can beat them on price, availability, and support
I guess I just want something fresh, but for now a Raspberry Pi will do…
Application
Some software is needed for the DDNS implementation. The actual HTTP/HTTPS request is simple, but some more potatoes are needed. Particularly the scheduling and/or triggering of the request periodically. The container shell is also needed.
Luckily, as mentioned before, LinuxServer.io have made a simple free and open source docker image for Duck DNS called docker-duckdns under the GNU general public license.
Requirements and Constraints
Since this is a home project; costs (especially monthly/anually ones) should be minimized/reasonable, so a free DDNS platform is highly preferred.
Here are some reasons why I chose not to use an existing device on their network:
- Whatever existing device I may choose can (read will) be replaced at some point beyond my control, and probably without warning
- Existing device on their network are still their devices. Which does not let me do whatever I want on them and they can do whatever they want with it (ex. shut it down, factory reset)
- Minimal required hands-on and setup by the family member
- Ease of install and ease of replacement However, since I don’t want to involve the family member in helping setting this up, and I don’t want the responsibility of “I touched it once, now it is my responsibility forever”, I am choosing to add a new device to the network with the sole purpose of
So the device I am looking for is something that is:
- Inexpensive or disposable/consumable
- Available and off-the-shelf
- Reliable (read: tested and supported)
- Able to run a simple service
- Can be supported remotely
Solution
Design
DDNS setup
Forking LinuxServer.io - docker-duckdns
Device
Support structure
Balena.io