📅 11 Oct 2021
I knew that hosting a website behind a residential ISP would lead to some interesting new issues. The first of those is handling Dynamic IP addresses. As many of you are likely aware, the IP address that you get from your ISP is likely to change at any time… a.k.a, is a dynamic ip address.
In my initial plans, I wanted to preserve some flexibility here, so I looked for a domain registrar & dns provider with an API and landed on google domains. I was imagining that I’d write a cron job that checked my IP using everyone’s favorite site, icanhazip.com, every minute. If I saw my IP address changing, then I’d run a script that called the google domains API and updated my DNS entry. I got this far, started looking into the google domains API, and then realized that this has probably already been solved much more easily.
I came across the set of services called Dynamic DNS, which exists to solve this exact problem. I ended up registering for noip.com, a free dynamic dns provider, and following the directions on their site to install the noip client on my raspberry pi. When you install it, their readme provides further instructions for configuring it as a service. I reconfigured my domain to use a CNAME instead of an A record, forward the root to www, and was good to go.
Next up: let’s load test this thing! or maybe talk about how to monitor and failover when we have a power outage.