{"id":346,"date":"2018-10-13T21:52:54","date_gmt":"2018-10-13T13:52:54","guid":{"rendered":"https:\/\/www.techcoil.com\/blog\/?p=346"},"modified":"2018-10-18T10:33:52","modified_gmt":"2018-10-18T02:33:52","slug":"how-to-get-your-raspberry-pi-3-to-use-namecheap-dynamic-dns-to-update-your-domain-when-your-homes-public-ip-address-changes","status":"publish","type":"post","link":"https:\/\/www.techcoil.com\/blog\/how-to-get-your-raspberry-pi-3-to-use-namecheap-dynamic-dns-to-update-your-domain-when-your-homes-public-ip-address-changes\/","title":{"rendered":"How to get your Raspberry Pi 3 to use Namecheap dynamic DNS to update your domain when your home&#8217;s public IP address changes"},"content":{"rendered":"<p>When you do not leave your modem and router on 24-7, chances are that your public IP address will change. As I had noted in <a href=\"https:\/\/www.techcoil.com\/blog\/how-to-host-multiple-websites-from-home\/\" rel=\"noopener\" target=\"_blank\">how to host multiple website at home<\/a>, a public IP address is needed for <a href=\"https:\/\/www.techcoil.com\/glossary\/http-client\/\" rel=\"noopener\" target=\"_blank\">HTTP clients<\/a> to reach your <a href=\"https:\/\/www.techcoil.com\/glossary\/http-server\/\" rel=\"noopener\" target=\"_blank\">HTTP servers<\/a> at home.<\/p>\n<p>On the other hand, a domain name allows us to map some meaningful English characters to that public IP address. Therefore, it is easier to access our servers with a domain name rather than an IP address.<\/p>\n<p>Although you can get a free subdomain from a dynamic DNS provider, getting your own domain name from a domain registrar like <a href=\"https:\/\/namecheap.pxf.io\/c\/1303251\/386170\/5618\" rel=\"noopener\" target=\"_blank\">Namecheap<\/a> can be better. On one hand, you get your own online branding for establishing yourself or your business on the Internet. On the other hand, you are resilient to having your domain shutdown by the dynamic DNS provider for any reasons that is beyond your control.<\/p>\n<p>Previously, I shared <a href=\"https:\/\/www.techcoil.com\/blog\/why-namecheap-is-the-best-domain-name-registrar-for-hosting-your-web-server-at-home\/\" rel=\"noopener\" target=\"_blank\">why Namecheap is the best domain name registrar for hosting your web server at home<\/a>. One of the reasons is that Namecheap provides dynamic DNS for us to update the host records of our domain whenever our public IP address changes. Since Raspberry Pi 3 is an affordable, small and energy efficient <a href=\"https:\/\/www.techcoil.com\/glossary\/single-board-computer\/\" rel=\"noopener\" target=\"_blank\">single board computer<\/a>, you can get it to use Namecheap Dynamic DNS service to update your domain when your home's public IP address changes. <\/p>\n<p>In case you need it, this is how to get Raspberry Pi 3 to use Namecheap dynamic DNS to update your domain when your home's public IP address changes.<\/p>\n<h2>Getting a cheap domain name from Namecheap<\/h2>\n<p>In case you are looking to buy a domain, you can head over to <a href=\"https:\/\/www.namecheap.com\/promos\/\" rel=\"noopener\" target=\"_blank\">Namecheap's promotions page<\/a> to check out their current promotions. In addition, you can <a href=\"https:\/\/namecheap.pxf.io\/c\/1303251\/386170\/5618?u=https%3A%2F%2Fwww.namecheap.com%2Fpromos%2Fcoupons%2F\" rel=\"noopener\" target=\"_blank\">checkout their coupons page<\/a> to get your domain with some discount. <\/p>\n<h2>Adding the necessary host records for your domain<\/h2>\n<p>After you had gotten your domain name from Namecheap, you will need to <a href=\"https:\/\/namecheap.pxf.io\/c\/1303251\/386170\/5618?u=https%3A%2F%2Fwww.namecheap.com%2Fsupport%2Fknowledgebase%2Farticle.aspx%2F434\" rel=\"noopener\" target=\"_blank\">setup some host records for your domain<\/a>. <\/p>\n<p>The host records page for your domain should look like the following:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/host-records-for-yourdomain.com-at-namecheap-dashboard.jpg\" alt=\"host records for yourdomain.com at Namecheap dashboard\" \/><\/p>\n<p><strong>Note that if you miss this step, you will find the following error message in <code>\/var\/log\/syslog<\/code> when you run DDClient later<\/strong>:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n\/var\/log\/syslog:Oct 13 12:35:08 raspberrypi ddclient&#x5B;5591]: WARNING:   &lt;?xml version=&quot;1.0&quot;?&gt;&lt;interface-response&gt;&lt;Command&gt;SETDNSHOST&lt;\/Command&gt;&lt;Language&gt;eng&lt;\/Language&gt;&lt;ErrCount&gt;1&lt;\/ErrCount&gt;&lt;errors&gt;&lt;Err1&gt;No Records updated. A record not Found;&lt;\/Err1&gt;&lt;\/errors&gt;&lt;ResponseCount&gt;1&lt;\/ResponseCount&gt;&lt;responses&gt;&lt;response&gt;&lt;ResponseNumber&gt;380091&lt;\/ResponseNumber&gt;&lt;ResponseString&gt;No updates; A record not Found;&lt;\/ResponseString&gt;&lt;\/response&gt;&lt;\/responses&gt;&lt;Done&gt;true&lt;\/Done&gt;&lt;debug&gt;&lt;!&#x5B;CDATA&#x5B;]]&gt;&lt;\/debug&gt;&lt;\/interface-response&gt;\r\n<\/pre>\n<p>Seeing the above error message will mean that your Raspberry Pi 3 was not able to update the public IP address record for your domain.<\/p>\n<h2>Enabling Dynamic DNS for your domain in Namecheap dashboard<\/h2>\n<p>After you had gotten your domain name from Namecheap, you will need to <a href=\"https:\/\/namecheap.pxf.io\/c\/1303251\/386170\/5618?u=https%3A%2F%2Fwww.namecheap.com%2Fsupport%2Fknowledgebase%2Farticle.aspx%2F595%2F11\" rel=\"noopener\" target=\"_blank\">enable Dynamic DNS for your Namecheap domain<\/a>. Once you had gone through the steps in the article, note down the <strong>Dynamic DNS password<\/strong> for updating your public IP address changes with Namecheap.<\/p>\n<h2>Recommended hardware list for your Raspberry Pi 3 DDNS client<\/h2>\n<p>In case you need a reference hardware list, you may refer to the following for building your Raspberry Pi 3 DDNS client:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.amazon.com\/CanaKit-Raspberry-Micro-Supply-Listed\/dp\/B01C6FFNY4\/ref=as_li_ss_tl?s=pc&ie=UTF8&qid=1517212574&sr=1-4&keywords=raspberry+pi+3&linkCode=ll1&tag=clivsperswebs-20&linkId=76113a630916ac804456aa1f5dd76c85\" rel=\"noopener\" target=\"_blank\">CanaKit Raspberry Pi 3 with 2.5A Micro USB Power Supply<\/a> or <a href=\"https:\/\/www.amazon.com\/CanaKit-Raspberry-Power-Supply-Listed\/dp\/B07BC6WH7V\/\/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=clivsperswebs-20&linkId=facc24accf03fbe5cd45b1893a1e9ab1\" rel=\"noopener\" target=\"_blank\">CanaKit Raspberry Pi 3 B+ (B Plus) with 2.5A Power Supply (UL Listed)<\/a><\/li>\n<li><a href=\"https:\/\/www.amazon.com\/dp\/B01F1PSFY6\/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=clivsperswebs-20&linkId=d68c56d79a1d84f89f596fa715743a9e\" rel=\"noopener\" target=\"_blank\">Raspberry Pi 2\/3 official case Black\/Grey<\/a> or <a href=\"https:\/\/www.amazon.com\/dp\/B01CCPKCSK\/ref=as_li_ss_tl?ie=UTF8&linkCode=ll1&tag=clivsperswebs-20&linkId=1e69ae5649504fb86c6597e0774eb3d8\" rel=\"noopener\" target=\"_blank\">Raspberry Pi 2\/3 official case Red\/White<\/a><\/li>\n<li><a href=\"https:\/\/www.amazon.com\/Sandisk-Ultra-128GB-Micro-Adapter\/dp\/B073JWXGNT\/ref=as_li_ss_tl?&imprToken=Uv1uiLcM.vyLYXreqRUKXw&slotNum=2&ie=UTF8&th=1&linkCode=ll1&tag=clivsperswebs-20&linkId=77ffb37eb1decb48a8cd320dc546a6ed\" rel=\"noopener\" target=\"_blank\"> Sandisk Ultra 32GB Micro SDHC UHS-I Card with Adapter<\/a><\/li>\n<li><a href=\"https:\/\/www.amazon.com\/gp\/product\/B00N2VISLW\/ref=as_li_tl?ie=UTF8&tag=clivsperswebs-20&camp=1789&creative=9325&linkCode=as2&creativeASIN=B00N2VISLW&linkId=132403a064ff21634835c1deee4bc983\" target=\"_blank\">AmazonBasics RJ45 Cat-6 Ethernet Patch Cable - 3 Feet (0.9 Meters)<\/a><\/li>\n<\/ul>\n<h2>Setting up Raspbian Stretch Lite with SSH server enabled on your microSD card<\/h2>\n<p>Once you had gathered all the necessary hardware, proceed to <a href=\"https:\/\/www.techcoil.com\/blog\/how-to-setup-raspbian-stretch-lite-with-ssh-server-enabled-on-your-microsd-card\/\" rel=\"noopener\" target=\"_blank\">setup Raspbian Stretch Lite with SSH server enabled on your microSD card<\/a>. Doing so will allow you to SSH into your Raspbian Stretch Lite to perform further configurations in this post. <\/p>\n<h2>Assembling the hardware for the Raspberry Pi 3 reverse proxy server<\/h2>\n<p>Once the ssh file is created in the boot partition of the microSD card, remove the microSD card from your SD card reader and insert it to the microSD card slot on the Raspberry Pi 3 board. After that, proceed to <a href=\"\/blog\/how-to-assemble-the-raspberry-pi-3-board-with-the-raspberry-pi-official-case\/\" target=\"_blank\">assemble the Raspberry Pi 3 board to the Official Raspberry Pi case<\/a>.<\/p>\n<h2>Starting the Raspbian Stretch Lite operating system<\/h2>\n<p>With the assembly of your Raspberry Pi 3 board and Official Raspberry Pi case, connect one end of the RJ45 cable to the RJ45 port on the Raspberry Pi 3 board and the other end of the cable to one of the switch port of your <a href=\"https:\/\/www.amazon.com\/s\/ref=as_li_ss_tl?url=search-alias=aps&field-keywords=home+router&linkCode=ll2&tag=clivsperswebs-20&linkId=dd988f9e10e1a419b9d518690e9c8cd8\" target=\"_blank\">home router<\/a>. After that, connect the micro USB power supply to the Raspberry Pi 3 board and a wall socket. Turn on the power socket to supply power to the Raspberry Pi 3 board.<\/p>\n<h2>Changing default password, Locale and Timezone of your Raspbian Stretch Lite<\/h2>\n<p>There are a few configurations that you should perform on the first run of your Raspbian Stretch Lite. Proceed on to <a href=\"https:\/\/www.techcoil.com\/blog\/set-of-configurations-to-perform-on-the-first-run-of-your-raspbian-stretch-lite\/\" rel=\"noopener\" target=\"_blank\">change the default password, Locale and Timezone of your Raspbian Stretch Lite<\/a>.  <\/p>\n<h2>Installing DDclient on your Raspbian Stretch Lite<\/h2>\n<p>Once you had changed the default password, Locale and Timezone of your Raspbian Stretch Lite, you can proceed to get a copy of <a href=\"https:\/\/sourceforge.net\/p\/ddclient\/wiki\/Home\/\" rel=\"noopener\" target=\"_blank\">DDclient<\/a> on your Raspbian Stretch Lite. In order to do so, run the following command:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo apt-get install ddclient -y\r\n<\/pre>\n<p>While the installation is taking place, a wizard will appear to help you configure DDClient to talk to a dynamic DNS provider. Since the configurations for Namecheap is different, you can get through the wizard with some arbitrary value to complete the installation. <\/p>\n<h2>Creating the DDclient configurations to set your public IP address to your Namecheap domain<\/h2>\n<p>When the installation for DDclient completes, DDclient will run as a service and check for IP changes every 5 minutes. In addition, it will look at <code>\/etc\/ddclient.conf<\/code> for instructions on how to update your public IP Address with dynamic DNS providers.<\/p>\n<p>In order to configure DDclient to set your home's public IP address to your Namecheap domain, open up <code>\/etc\/ddclient.conf<\/code> with <code>nano<\/code>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo nano \/etc\/ddclient.conf\r\n<\/pre>\n<p>After the nano editor loads the file, change the contents to look like the following:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n# Configuration file for ddclient generated by debconf\r\n#\r\n# \/etc\/ddclient.conf\r\n\r\nprotocol=namecheap\r\nuse=web, web=dynamicdns.park-your-domain.com\/getip\r\nserver=dynamicdns.park-your-domain.com\r\n# Change the following to your Namecheap domain\r\nlogin=yourdomain.com\r\n# Change the following to the Dynamic DNS Password that you will find in your Namecheap dashboard\r\npassword=a3f5f501589245dAacaf4d20d37Ed7f1\r\n@\r\n<\/pre>\n<p>When you are done, press <strong>Ctrl-X<\/strong> followed by <strong>Y<\/strong> to save your changes.<\/p>\n<p>Next, run the following command to get DDclient to pick up the new configurations:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsudo systemctl restart ddclient.service \r\n<\/pre>\n<p>Given that, Namecheap DNS servers will be notified when your home's public IP address changes. Whenever, a Namecheap DNS server's receives a DNS request for your domain, it will send your home's public IP address back to the requester. <\/p>\n<h2>Building a reverse proxy server to host multiple websites from your home<\/h2>\n<p>Once you are able to map your domain name to your home's public IP address, you will be able to <a href=\"https:\/\/www.techcoil.com\/blog\/how-to-host-multiple-websites-from-home\/\" rel=\"noopener\" target=\"_blank\">host multiple websites from your home<\/a>. In order to do so, you may want to consider <a href=\"https:\/\/www.techcoil.com\/blog\/building-a-reverse-proxy-server-with-nginx-certbot-raspbian-stretch-lite-and-raspberry-pi-3\/\" rel=\"noopener\" target=\"_blank\">building a reverse proxy server with Nginx, Certbot, Raspbian Stretch Lite and Raspberry Pi 3<\/a>. You can either choose to do that on the Raspberry Pi 3 that runs DDClient, or on another Raspberry Pi 3. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/How-to-get-your-Raspberry-Pi-3-to-use-Namecheap-DNS-to-update-your-homes-IP-address.jpg\" alt=\"How to get your Raspberry Pi 3 to use Namecheap DNS to update your home&#039;s IP address\" \/><\/p>\n\n      <ul id=\"social-sharing-buttons-list\">\n        <li class=\"facebook\">\n          <a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fwp.me%2Fp245TQ-5A\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n            <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Facebook.png\" alt=\"Facebook icon\"> Share\n          <\/a>\n        <\/li>\n        <li class=\"twitter\">\n          <a href=\"https:\/\/twitter.com\/intent\/tweet?text=&url=https%3A%2F%2Fwp.me%2Fp245TQ-5A&via=Techcoil_com\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Twitter.png\" alt=\"Twitter icon\"> Tweet\n          <\/a>\n        <\/li>\n        <li class=\"linkedin\">\n          <a href=\"https:\/\/www.linkedin.com\/shareArticle?mini=1&title=&url=https%3A%2F%2Fwp.me%2Fp245TQ-5A&source=https:\/\/www.techcoil.com\" target=\"_blank\" role=\"button\" rel=\"nofollow\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/linkedin.png\" alt=\"Linkedin icon\"> Share\n          <\/a>\n        <\/li>\n        <li class=\"pinterest\">\n          <a href=\"https:\/\/pinterest.com\/pin\/create\/button\/?url=https%3A%2F%2Fwww.techcoil.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F346&description=\" class=\"pin-it-button\" target=\"_blank\" role=\"button\" rel=\"nofollow\" count-layout=\"horizontal\">\n          <img decoding=\"async\" src=\"\/ph\/img\/3rd-party\/social-icons\/Pinterest.png\" alt=\"Pinterest icon\"> Save\n          <\/a>\n        <\/li>\n      <\/ul>\n    ","protected":false},"excerpt":{"rendered":"<p>When you do not leave your modem and router on 24-7, chances are that your public IP address will change. As I had noted in <a href=\"https:\/\/www.techcoil.com\/blog\/how-to-host-multiple-websites-from-home\/\" rel=\"noopener\" target=\"_blank\">how to host multiple website at home<\/a>, a public IP address is needed for <a href=\"https:\/\/www.techcoil.com\/glossary\/http-client\/\" rel=\"noopener\" target=\"_blank\">HTTP clients<\/a> to reach your <a href=\"https:\/\/www.techcoil.com\/glossary\/http-server\/\" rel=\"noopener\" target=\"_blank\">HTTP servers<\/a> at home.<\/p>\n<p>On the other hand, a domain name allows us to map some meaningful English characters to that public IP address. Therefore, it is easier to access our servers with a domain name rather than an IP address.<\/p>\n<p>Although you can get a free subdomain from a dynamic DNS provider, getting your own domain name from a domain registrar like <a href=\"https:\/\/namecheap.pxf.io\/c\/1303251\/386170\/5618\" rel=\"noopener\" target=\"_blank\">Namecheap<\/a> can be better. On one hand, you get your own online branding for establishing yourself or your business on the Internet. On the other hand, you are resilient to having your domain shutdown by the dynamic DNS provider for any reasons that is beyond your control.<\/p>\n<p>Previously, I shared <a href=\"https:\/\/www.techcoil.com\/blog\/why-namecheap-is-the-best-domain-name-registrar-for-hosting-your-web-server-at-home\/\" rel=\"noopener\" target=\"_blank\">why Namecheap is the best domain name registrar for hosting your web server at home<\/a>. One of the reasons is that Namecheap provides dynamic DNS for us to update the host records of our domain whenever our public IP address changes. Since Raspberry Pi 3 is an affordable, small and energy efficient <a href=\"https:\/\/www.techcoil.com\/glossary\/single-board-computer\/\" rel=\"noopener\" target=\"_blank\">single board computer<\/a>, you can get it to use Namecheap Dynamic DNS service to update your domain when your home&#8217;s public IP address changes. <\/p>\n<p>In case you need it, this post shows how to get your Raspberry Pi 3 to use Namecheap dynamic DNS to update your domain when your home&#8217;s public IP address changes.<\/p>\n","protected":false},"author":1,"featured_media":1311,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":""},"categories":[4],"tags":[570,580,571,569,568,240,438],"jetpack_featured_media_url":"https:\/\/www.techcoil.com\/blog\/wp-content\/uploads\/Namecheap-logo.jpg","jetpack_shortlink":"https:\/\/wp.me\/p245TQ-5A","jetpack-related-posts":[],"jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts\/346"}],"collection":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/comments?post=346"}],"version-history":[{"count":0,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/posts\/346\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/media\/1311"}],"wp:attachment":[{"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/media?parent=346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/categories?post=346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techcoil.com\/blog\/wp-json\/wp\/v2\/tags?post=346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}