{"id":11,"date":"2011-10-11T21:26:00","date_gmt":"2011-10-11T21:26:00","guid":{"rendered":"http:\/\/cazenave.co.uk\/wp\/?p=11"},"modified":"2014-04-24T22:06:14","modified_gmt":"2014-04-24T22:06:14","slug":"dynamic-dns-services-and-ddclient","status":"publish","type":"post","link":"https:\/\/cazenave.co.uk\/dynamic-dns-services-and-ddclient\/","title":{"rendered":"Dynamic DNS services and ddclient"},"content":{"rendered":"

Since changing from O2 to Virgin broadband, I’ve had to hope my dynamic external IP address didn’t change too often. As it turns out, Virgin appear to have a very slow turnover of IPs for home customers, since I’ve had the same one since we changed. I wrote a little script to scrape my IP from http:\/\/checkip.dyndns.org every 10 minutes and save the output do Dropbox, but this seemed less than optimal.<\/p>\n

I recently read about a nifty little client called ddclient<\/a>. If your router doesn’t support updating a dynamic DNS service (such as www.dyndns.org) for you, then having a tool like ddclient do it for you is pretty handy.<\/p>\n

It’s a little perl utility, which on Slackware requires some external dependencies (perl-IO-Socket-SSL<\/a>, Net-SSLeay<\/a>, libwww-perl<\/a>, perl-html-parser<\/a> and perl-html-tagset<\/a>) available from SlackBuilds.org. Set up is pretty straightforward, and the default configuration file (\/etc\/ddclient\/ddclient.conf<\/span>) is pretty comprehensive. I found, however, it was a bit overwhelming, and the documentation on the website was more useful. In the end, my configuration looked like this:<\/p>\n

# Stripped down version of the config file. <\/span>
# <\/span>Easier to manage, I think.<\/span><\/p>\n

daemon=600                      # update every 10 minutes<\/span>
syslog=yes                      # write to syslog<\/span>
mail=root                       # all messages go to root<\/span>
mail-failure=root               # failures sent to root too<\/span>
pid=\/var\/run\/ddclient.pid       # runtime pid file<\/span>
# host setup<\/span>
ssl=yes                         # use ssl when updating hostname<\/span>
protocol=dyndns2                # using dyndns.org<\/span>
use=web, web=checkip.dyndns.org\/, web-skip=’IP Address’<\/span>
#use=web                        # get ip from internet<\/span>
login=myusername                # username<\/span>
password=mypassword             # duh…<\/span>
my.hostname.com                 # my hostname<\/span><\/p><\/blockquote>\n

I set the daemon to run every ten minutes and it uses www.dyndns.org to update the IP associated with my.hostname.com. I altered the line use=web<\/span> to use=web, web=checkip.dyndns.org\/, web-skip=’IP Address’<\/span><\/span> because I was getting errors with ddclient finding the checkip.dyndns.org address. In theory, this forces ddclient to parse the output from checkip.dyndns.org correctly. <\/p>\n

In the end, ddclient does a very similar thing to my suboptimal approach, though it updates my dyndns account for me rather than me having to do so from the Dropbox text file to which my script saved my IP address.<\/p>\n","protected":false},"excerpt":{"rendered":"

Since changing from O2 to Virgin broadband, I’ve had to hope my dynamic external IP address didn’t change too often. As it turns out, Virgin appear to have a very slow turnover of IPs for home customers, since I’ve had the same one since we changed. I wrote a little script to scrape my IP […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[19,25,26,27,24,22,29,14,28,15],"tags":[],"_links":{"self":[{"href":"https:\/\/cazenave.co.uk\/wp-json\/wp\/v2\/posts\/11"}],"collection":[{"href":"https:\/\/cazenave.co.uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cazenave.co.uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cazenave.co.uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cazenave.co.uk\/wp-json\/wp\/v2\/comments?post=11"}],"version-history":[{"count":0,"href":"https:\/\/cazenave.co.uk\/wp-json\/wp\/v2\/posts\/11\/revisions"}],"wp:attachment":[{"href":"https:\/\/cazenave.co.uk\/wp-json\/wp\/v2\/media?parent=11"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cazenave.co.uk\/wp-json\/wp\/v2\/categories?post=11"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cazenave.co.uk\/wp-json\/wp\/v2\/tags?post=11"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}