{"id":812,"date":"2011-01-30T06:24:55","date_gmt":"2011-01-30T06:24:55","guid":{"rendered":"http:\/\/wiki.davelevy.info\/?p=812"},"modified":"2023-04-27T08:26:16","modified_gmt":"2023-04-27T08:26:16","slug":"ddclient","status":"publish","type":"post","link":"https:\/\/davelevy.info\/wiki\/ddclient\/","title":{"rendered":"ddclient"},"content":{"rendered":"<p><i>ddclient<\/i> is a program for Linux that negotiates with <a href=\"http:\/\/dyndns.com\">http:\/\/dyndns.com<\/a> to allow systems with dynamic tcp\/ip addresses to have static DNS names. This was originally written in 2011, and revisited in 2013. dyndns abandoned their free product some time ago, possibly as a result of being bought by Oracle. I marked the page is &#8216;deprecated&#8217; on 4th Feb 2019.&nbsp;The rest of this article comprise my notes on how to install ddclient on an AMI.&nbsp;<!--more--><\/p>\n<h3>2013<\/h3>\n<p>I made a new Amazon machine. Don&#8217;t muck around, install ddclient using apt-get. The post install script now takes you through the critical configuration questions and writes a .conf file.<\/p>\n<p>If you make the AMI first, you have the AWS public IP address from the public ip name. The curl command below also still works<\/p>\n<ol>\n<li>Make a dns name at dyndns.org, use the AMI public ip address<\/li>\n<li>Install ddclient using apt-get<\/li>\n<li>Choose www.dyndns.com<\/li>\n<li>Provide your login\/password<\/li>\n<li>Select checkip.dyndns.com<\/li>\n<li>Use select from list<\/li>\n<li>Select your domain name<\/li>\n<li>Wait for the name to propagate &lt;- most imortant<\/li>\n<\/ol>\n<h3>2011<\/h3>\n<p>I decided to use ddclient to keep a constant name on <a href=\"https:\/\/davelevy.info\/wiki\/amazon-web-services\/\">my Amazon EC2 Machine<\/a>. This was an Ubuntu image. I therefore have the choice of using the package manager or a tarball install, although the latter is not automated.<\/p>\n<h3>Obtaining the Package from dyndns<\/h3>\n<p>I originally downloaded it from dyndns.com and installed it on my, <em>now defunct<\/em>, Cobalt Qube.<\/p>\n<p>This section was written in 2011 when I replaced my Cobalt Qube with an AMI.<\/p>\n<p>I used <i>wget<\/i> to pull down http:\/\/cdn.dyndns.com\/ddclient.tar.gz. This was version 3.7.3. It has a <b>README<\/b> which documents how to install the client. I used <i>update-rd.d<\/i> to install the start\/stop script which I called rc.ddclient. I used the debian sample as my model. This required the addition of the <a href=\"http:\/\/wiki.debian.org\/LSBInitScripts\">LSB Init Headers<\/a>. I added the login credentials to the appropriate configuration file.<\/p>\n<ul>\n<li>The guys at ddclient say I didn&#8217;t look hard enough for an LSB compliant script.<\/li>\n<li>The default configuration file is held at \/etc\/ddclient\/ddclient.conf.<\/li>\n<\/ul>\n<p>ddclient needs a directory, \/var\/cache\/ddclient, it doesn&#8217;t make it in the initialisation scripts, so this needs to be done by hand.<\/p>\n<p>I have an <b>Ubuntu<\/b> image so I needed to install the PERL SSL libraries.<\/p>\n<div>\n<pre>sudo apt-get install libio-socket-ssl-perl<\/pre>\n<\/div>\n<p>other distros may have this already, and using the package manager does this for you.<\/p>\n<p><b>N.B.<\/b> ddclient tries to mail its messages. My server doesn&#8217;t have sendmail configured. This seems to be configurable using parameters in the config file. &lt;say more here&gt;<\/p>\n<h3>Using an Ubuntu package<\/h3>\n<p>ddclient is available as a package and can be installed the usual way<\/p>\n<div>\n<pre>apt-get install ddclient<\/pre>\n<\/div>\n<p>It doesn&#8217;t have an EC2 option and the post install script is interactive. I chose the simplest I could and then edited the config files by hand.<\/p>\n<p>It locates stuff in different places as Ubuntu usually does.<\/p>\n<p>It has a script conf file in \/etc\/default\/ddclient, this is a shell and impacts the initscript. It has three switches which determine if it runs as a daemon and how frequently it polls.<\/p>\n<p>The default conf file is \/etc\/ddclient.conf not \/etc\/ddclient\/ddclient.conf. I have linked this location to my conf file in \/etc\/ddclient. So I now meet both standards, and I hope can use apt-get to keep the package up to date.<\/p>\n<h3>Discovering the instance public address<\/h3>\n<p>In addition to the instructions in the ddclient <b>README<\/b>, I needed to look at the instructions documented at <a href=\"https:\/\/web.archive.org\/web\/20160304013840\/http:\/\/blog.codesta.com\/codesta_weblog\/2008\/02\/amazon-ec2---wh.html\">Amazon EC2 &#8211; What You May Not Have Known<\/a> a blog article at codesta.com. This details the magic runes required to make ddclient <b>work for an amazon ec2 instance<\/b>. It clearly needs the public ip address and uses the ddclient -cmd tool to get it.<\/p>\n<div>\n<pre>use=cmd, cmd='curl http:\/\/169.254.169.254\/2007-08-29\/\/meta-data\/public-ipv4'\nprotocol=dyndns2\nserver=members.dyndns.org\nwildcard=YES\ncustom=yes, your.server1.com, your.server2.com<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>ddclient is a program for Linux that negotiates with http:\/\/dyndns.com to allow systems with dynamic tcp\/ip addresses to have static DNS names. This was originally written in 2011, and revisited in 2013. dyndns abandoned their free product some time ago, possibly as a result of being bought by Oracle. I marked the page is &#8216;deprecated&#8217;&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4066,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","_share_on_mastodon":"0"},"categories":[111,3],"tags":[112,161,1283,1184,122,231,914,920,911],"class_list":["post-812","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-technology","tag-cloud-2","tag-ddclient","tag-ddns","tag-deprecated","tag-dns","tag-dyndns","tag-networking","tag-software","tag-technology"],"share_on_mastodon":{"url":"","error":""},"jetpack_featured_media_url":"https:\/\/davelevy.info\/wiki\/wp-content\/uploads\/2009\/07\/html-from-makeuseof_com-w650c.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/812","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/comments?post=812"}],"version-history":[{"count":10,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/812\/revisions"}],"predecessor-version":[{"id":7897,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/posts\/812\/revisions\/7897"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media\/4066"}],"wp:attachment":[{"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/media?parent=812"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/categories?post=812"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davelevy.info\/wiki\/wp-json\/wp\/v2\/tags?post=812"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}