Cloudflare Dynamic DNS Jul 15, 2015

php  script 

Replacing external dynamic dns services.

I wrote a small script in PHP that checks your external IP, compares it with a Cloudflare DNS A record, and updates it when it is different. This saves you the trouble from registering to an external service, like DynDNS, which forces you to login every month to keep the domain active. For a couple of bucks a year if you don't have a domain or for free if you do, you can access your home server with an easy to remember domain name.

How does it work?

It gets the A record from Cloudflare, detects your external IP using a website and compares the two. If they are different the Cloudflare record is updated. If you want to go more into the details you can find the code on Github.



I use a Jenkins setup to call the script every hour, you can also use a cron service or add the script to your boot sequence. You can find some information about these methods in the links below.


Cloudflare has a tutorial on how to use ddclient for the same purpose. You can find it here.

Questions or Bugs?

Create an issue on Github or contact me on Twitter @kidk.