Bringing CloudFlare Home

I have been happily using CloudFlare for a couple of months. I like their very sleek web interface for control of CloudFlare settings, especially on the DNS portion. The next thing that came to my mind was to find the CloudFlare API to update the IP of my home broadband to CloudFlare. So, I started searching for a CloudFlare API, and what did I find? A ddclient port from CloudFlare. Geeks think alike I guess.

The ddclient port is here https://github.com/cloudflare/CloudFlare-Tools.

Let me quickly sum up everything in a few steps

1. Get a CloudFlare API key from the CloudFlare site. Go to ‘Account’

CloudFlare Account Header

2. Generate an API key at the bottom of the page.

3. Checkout the CloudFlare Tools from the Git repository.

4. Get the ddclient and copy it to somewhere you are comfortable with. I keep all my external programs in /opt/local/bin

5. By default, ddclient looks for the config file in /etc/ddclient/ddclient.conf, for simplicity sake, just create the file in /etc/ddclient.

6. This is how the config looks like.

bash-3.2# cat ddclient.conf 
ssl=yes use=webprotocol=cloudflare, \
server=www.cloudflare.com, \
login=<your cloudflare login>, \
password=cloudflare api key here> \
host1.domain.com, host2.domain.com # you can have multiple hostname, delimited by commas bash-3.2#

7. You can run ddclient as a daemon or for my case, I run it as a cron job. I’m too lazy to go figure out the launchctl thing on OS X.

I’m running a simple web server on my home server for testing purposes. And like any regular CloudFlare setup, you can make use of the security features. And that’s it, you are bringing CloudFlare home!

Author: yibi

YiBi's numb :) YiBi writes about anything. Technology, Gossips, Rubbish YiBi's a half f%#k geek :P

This is useful? Please leave your comment or Share this on Facebook!

This site uses Akismet to reduce spam. Learn how your comment data is processed.