Use Cloudflare as a Dynamic DNS with a simple script
Let’s say you’re experimenting with a Raspberry Pi or have an old computer and you want to host a website at home instead of buying a subscription to a VPS. You go ahead, craft your best CSS, link a cool domain name to your IP, forward the ports, start Apache or nginx or whatever and there you go: home-made web server, nice!
But then, your crappy router decides to have a problem and you have to reset it. And when it’s back on, you discover with horror that your provider assign the IP address dynamically and guess what: your IP changed and your website is now unreachable.
Now there are three solutions to this problem:
- Switch to a provider which supplies static IPs
- Manually change the IP address of the A record of your domain DNS everytime the router decides to act weird
- Set up an automatic script to change the IP address of the A record of your domain DNS and go make a pie
Continue reading →