Gianfranco Palumbo

  • Archive
  • RSS
  • Ask me anything

Raspberry Pi with Cloudflare’s Dynamic DNS (ddclient)

Tested with: Raspberry Pi - Model B with 256mb of RAM

Raspberry Pi

I’ve used DynDNS and other providers (which even my Cisco router supports) but instead of using a horrible domain-name, I wanted to use a subdomain of my personal domain. eg. raspberrypi.mydomain.com

If you don’t have Cloudflare i recommend it not only because they give you tons of features for your website but also because it’s a reliable DNS (better than GoDaddy at least), plus did I mentioned almost everything is free? :)

The latest version of raspbian, the Debian distribution optimised for the Raspberry Pi, is 2012-09-18-wheezy-raspbian.zip (as to this writing)

Once you have enabled ssh, connect to it via your main computer or use your USB keyboard to type this commands. (I left it powered via my router USB port and plugged the Ethernet cable to it)

Install the ddclient required packages.

$ sudo apt-get install sendmail
$ sudo apt-get install libio-socket-ssl-perl

Download this version 3.8.1-r of ddclient (others might work too) https://gist.github.com/3942373 (This is the patched version from robertianhawdon.me.uk )

$ wget https://gist.github.com/gists/3942373/download
$ sudo mv ddclient /usr/sbin/
$ sudo chmod +x /usr/sbin/ddclient
$ mkdir -p /etc/ddclient/
$ sudo nano /etc/ddclient/ddclient.conf


daemon=300                              # check every 300 seconds
syslog=yes                              # log update msgs to syslog
mail=root                               # mail all msgs to root
mail-failure=root                       # mail failed update msgs to root
pid=/var/run/ddclient.pid               # record PID in file.
ssl=yes                                 # use ssl-support.  Works with
                                        # ssl-library

use=web, web=checkip.dyndns.com/, web-skip='IP Address'
cache=/tmp/ddclient.cache

#
## CloudFlare (cloudflare.com)
##
protocol=cloudflare,                           \
server=www.cloudflare.com,                     \
login=<cloudflare_email_login>                 \
password=<cloudflare_api_key>                  \
<domain_or_subdomain_on_CF>,

Replace the login, password (the api key from your CF account) and the domain or subdomain you want to update the IP to.

Then run to verify that everything works fine:

$ sudo ddclient -daemon=0 -debug -verbose -noquiet

That’s it!

$ sudo ddclient

Just run this ^ to start the process in the background, aka as a daemon.

Now just forward the ssh or any other port, you want to be able to connect from the ‘world’, from your router to Raspberry Pi ip-address.

Tips: - Change the sshd port from the 22 default (a lot of bots/hackers will try to bruteforce your password) Even better use a ssh key (how to generate one)

(any issues or comments tweet me @gianpaj)

    • #dns
    • #raspberrypi
    • #cloudflare
    • #ddclient
  • 6 months ago
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
← Previous • Next →

About

Avatar Gianfranco Palumbo
Dublin, Ireland


Software Engineer - House/Techno DJ - Addicted to Tech News - Social Media Savvy

Pages

  • ListenToItLater.co
  • About.Me
  • MixCloud
  • DIT DJ Society Tumblr
  • Ask me anything

Me, Elsewhere

  • @gianpaj on Twitter
  • Facebook Profile
  • gianpaj on Soundcloud
  • Linkedin Profile
  • gianpa on github

Twitter

loading tweets…

Following

  • funsubstance
  • tastefullyoffensive
  • 9gag
  • dbareactions
  • consumeconsume
  • dairecarolan
  • realgirlsgaming
  • david
  • darraghdoyle
  • threadless
  • dublintown-ie
  • dead-mau5
  • fancyhands
  • nitetom
  • thecodinglove
  • joshuagordonphotography
  • staff
  • clisare
  • lorcanmak
  • postcardsto10gen
  • thoughtbot
  • devopsreactions
  • moombahton
  • littlebigdetails
  • whatshouldwecallsocialmedia
  • nateweiner
  • gabyspartz
  • mixes
  • juniorspesh
  • marconisida
  • jaychesters
  • flyingfijian
  • deadmau5
  • awesomepeoplehangingouttogether
  • inspiredbyapple
  • orlaithross
  • beautifultype
  • nobreastsnorequests
  • michaelarkins
  • thelackoforiginality
  • developers
  • engineering
  • moodyknows
  • thedevilsteeth
  • mau5blog
  • pogobat
  • ditdjsoc
  • nogrules
  • whisperjack
  • bustyourchops
  • tuttoirlanda
  • chkhito
  • dancefloormayhem
  • replacementhipsters
  • nointerface
  • aaronstopit
  • kyrobeshay
  • sharonwithad
  • workityworked
  • listenitlater
  • orangepxl
  • startupragecomics
  • hipstergrammers
  • buttersafe
  • takebackthursdays
  • coolandcreativename
  • hoxtonwhore
  • horsesheads
  • bouncykitten
  • thunderleif
  • v1be
  • ckohnphotography
  • thegardenmix
  • hayes2010

I Dig These Posts

See more →
  • Post via staff
    News!

    Everyone, I’m elated to tell you that Tumblr will be joining Yahoo.

    Before touching on how awesome this is, let me try to allay any concerns:...

    Post via staff
  • Photo via nitetom

    funsubstance:

    Best conspiracy theory ever

    Photo via nitetom
  • Photo via nitetom

    funsubstance:

    Silly cosmo

    Photo via nitetom
  • Photoset via tastefullyoffensive

    9 Pinterest Fails

    Photoset via tastefullyoffensive
  • Photo via funsubstance

    Like a moss

    Photo via funsubstance
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile
Effector Theme by Pixel Union