{"id":39,"date":"2017-07-03T20:25:02","date_gmt":"2017-07-03T08:25:02","guid":{"rendered":"https:\/\/content.ronella.xyz\/apps\/wordpress\/?p=39"},"modified":"2017-07-05T19:12:58","modified_gmt":"2017-07-05T07:12:58","slug":"configuring-dynamic-dns-with-noip-in-raspberry-pi","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=39","title":{"rendered":"Using NoIP&#8217;s Dynamic DNS Update Client (DUC) with Raspberry Pi"},"content":{"rendered":"<p>Sometimes we wanted our personal service to be hosted in our own network at home and we wanted it to be accessible via internet. However, our ISP doesn't provided us with a static IP. Thus our public IP could be anything for some moment. Knowing this different IP's is not ideal and tedious. This is where a service like NoIP comes in where it gives a more easy to remember hostname that is attached to your current public IP. But keeping it updated is still a tedious thing to do. \u00a0This is where we can use Raspberry Pi to do this task for us.<\/p>\n<h3>Assumption<\/h3>\n<ul>\n<li>Windows is being used for configuration.<\/li>\n<\/ul>\n<h3><strong>Pre-requisites<\/strong><\/h3>\n<ul>\n<li>Existing NoIP account with registered hostname or sign up <a href=\"https:\/\/www.noip.com\/sign-up\" target=\"_blank\" rel=\"noopener\">here<\/a>\u00a0and register a hostname.<\/li>\n<li>Existing Raspberry Pi Server or setup a new one.<\/li>\n<li><a href=\"https:\/\/winscp.net\/eng\/index.php\" target=\"_blank\" rel=\"noopener\">WinSCP <\/a>is installed <em>(or any SFTP client you know how to use)<\/em>. In the \u00a0procedure I am only using WinSCP for simplicity.<\/li>\n<li><a href=\"http:\/\/www.putty.org\/\" target=\"_blank\" rel=\"noopener\">Putty <\/a>is installed <em>(or any SSH client you know how to use)<\/em>. In the procedure I am only using Putty for simplicity.<\/li>\n<\/ul>\n<h3>Procedure<\/h3>\n<ol>\n<li>Download\u00a0<strong>Dynamic DNS Update Client for Linux<\/strong> <a href=\"https:\/\/www.noip.com\/download?page=linux\" target=\"_blank\" rel=\"noopener\">here<\/a>\u00a0<em>(i.e. normally named <strong>noip-duc-linux.tar.gz<\/strong>)<\/em>.<\/li>\n<li><strong>Using WinSCP upload the newly downloaded file to the home directory of the account with sudo group on your target Raspberry Pi<\/strong>. The output is similar to the following when using the default pi user:<a href=\"https:\/\/www.ronella.xyz\/wordpress\/wp-content\/uploads\/2017\/07\/noip-winscp-to-raspberry-pi.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-55\" src=\"https:\/\/www.ronella.xyz\/wordpress\/wp-content\/uploads\/2017\/07\/noip-winscp-to-raspberry-pi.png\" alt=\"\" width=\"1236\" height=\"506\" \/><\/a><\/li>\n<li><strong>Using putty sign-in to your Raspberry Pi using the account\u00a0you used in the previous step.<\/strong><\/li>\n<li><strong>In your home directory extract the tarball<\/strong> using the following command:\n<pre>tar -zxf noip-duc-linux.tar.gz<\/pre>\n<p>The extract is a directory similar to the following format:<\/p>\n<pre>noip-&lt;version&gt;<\/pre>\n<\/li>\n<li><strong>Go into the extracted folder and install<\/strong>\u00a0using the following commands:\n<pre>sudo make\r\nsudo make install<\/pre>\n<\/li>\n<li><strong>Type in your login or email address<\/strong>\u00a0<em>(i.e. you used on noip sign up )<\/em> and <strong>press Enter<\/strong>.<\/li>\n<li><strong>Type in your password<\/strong> <em>(i.e. you used on noip sign up )\u00a0<\/em>and <strong>press Enter<\/strong>.<\/li>\n<li><strong>Type in your update interval<\/strong> and <strong>press Enter or just press Enter<\/strong> <em>(i.e. if default [30] is good for you)<\/em>.<\/li>\n<li><strong>Press Enter<\/strong> and the output is similar to the following if your noip version is 2.1.9-1:<br \/>\n<a href=\"https:\/\/www.ronella.xyz\/wordpress\/wp-content\/uploads\/2017\/07\/noip-ssh-configuration.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-58\" src=\"https:\/\/www.ronella.xyz\/wordpress\/wp-content\/uploads\/2017\/07\/noip-ssh-configuration.png\" alt=\"\" width=\"990\" height=\"708\" \/><\/a><\/li>\n<li><strong>Go to \/etc\/init.d directory<\/strong> with the following commad:\n<pre>cd \/etc\/init.d<\/pre>\n<\/li>\n<li><strong>Create a noip2 file<\/strong> with the following command:\n<pre>sudo vi noip2<\/pre>\n<\/li>\n<li><strong>Type i<\/strong>\u00a0<em>(i.e. insert mode)<\/em> and <strong>paste the following script<\/strong>:\n<pre>#! \/bin\/sh\r\n#. \/etc\/rc.d\/init.d\/functions   # uncomment\/modify for your killproc\r\ncase \"$1\" in\r\nstart)\r\necho \"Starting noip2.\"\r\nsleep 10\r\n\/usr\/local\/bin\/noip2\r\n;;\r\nstop)\r\necho -n \"Shutting down noip2.\"\r\nkillproc -TERM \/usr\/local\/bin\/noip2\r\n;;\r\n*)\r\necho \"Usage: $0 {start|stop}\"\r\nexit 1\r\nesac\r\nexit 0\r\n<\/pre>\n<\/li>\n<li><strong>Type :wq<\/strong>\u00a0<em>(i.e. write and quit)<\/em> and then <strong>press enter<\/strong>.<\/li>\n<li><strong>Make the script executable<\/strong> with the following command:\n<pre>sudo chmod 755 noip2<\/pre>\n<\/li>\n<li><strong>Go to \/etc\/rc3.d directory<\/strong> with the following command:\n<pre>cd \/etc\/rc3.d<\/pre>\n<\/li>\n<li><strong>Create a symbolic link named S05noip2 pointing to the noip2 script<\/strong> you've created earlier with the following command:\n<pre>sudo ln -s ..\/init.d\/noip2 S05noip2<\/pre>\n<\/li>\n<\/ol>\n<h3>Validation<\/h3>\n<p>After completing the procedure above, do the following:<\/p>\n<ol>\n<li>Identify your current public IP <a href=\"https:\/\/www.whatismyip.com\/what-is-my-public-ip-address\/\" target=\"_blank\" rel=\"noopener\">here<\/a>\u00a0and <strong>note it<\/strong>.<\/li>\n<li><strong>Ping the hostname you've registered to NoIP<\/strong> using the command terminal and <strong>check if it is equal to the IP you've noted<\/strong> from the previous step.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes we wanted our personal service to be hosted in our own network at home and we wanted it to be accessible via internet. However, our ISP doesn&#8217;t provided us with a static IP. Thus our public IP could be anything for some moment. Knowing this different IP&#8217;s is not ideal and tedious. This is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/39"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=39"}],"version-history":[{"count":26,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/39\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/39\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=39"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=39"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=39"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}