Detecting IP change and updating the DNS for your Homelab without any code
Many people run Homelabs (the author included 😊) which we would like to access from the outside of our network, in order to check DVR, Home Assistant or simply see how is our Homelab is behaving after a big update
Most Internet service providers do not offer a static IP address (or they do for a hefty sum) but rather a dynamic one, which changes randomly
To securely expose your homelab to the internet, there are usually two paths you can take: using a third-party service like Cloudflare Tunnel or setting up your own domain and a reverse proxy like Caddy
Using our own domain gives us full control over our setup, plus the added bonus of not having to deal with third-party services
Using Lepilo, we can handle the problem of our home network IP changing and the DNS of our domain pointing to the previous IP address
Detecting IP Change and Updating DNS
We have recently released Scheduled Flow, which allows you to schedule when a Flow should run: every x minutes/hours/days, on a specific date, or on a specific day.
We have prepared Detecting IP Change and Updating DNS Flow which sets up the tasks you will need
-
With HTTP request task and Ipify we can detect current IP address ’
-
With KV Read and If/Else we can check if the IP address has changed
-
After detecting the IP change, we can update the DNS entry of our domain using an HTTP request
Please refer to the API documentation of your domain registrar to include the necessary URL, authorization, and other required details
When developing your Flow, you can use Dev mode to prototype faster -
With KV Write we can save the new IP address which will be on the next scheduling
- Download Lepilo client to your Homelab
You can also use Packed Client which embeds the Flow inside the Lepilo client - Run your Flow
Linux/Mac -
./lepilo-client run detecting_ip_change_and_updating_dns.lepilo
Windows -./lepilo-client.exe run detecting_ip_change_and_updating_dns.lepilo
Linux/Mac -
./detecting_ip_change_and_updating_dns run
Windows -./detecting_ip_change_and_updating_dns.exe run
- Download Lepilo client to your Homelab
Congratulations! Your Homelab now detects automatic IP change detection
Thank you for using Lepilo. Your support means the world to us 🙏