<p><a href="https://mastodon.me.uk/@kevie">Kevie</a>, co-host of <a href="https://tuxjam.otherside.network">TuxJam</a>, discusses what a Dynamic DNS is and also introduces the free service DuckDNS. To complete this project you are going to need:</p>
<ul>
<li>Raspberry Pi</li>
<li>Pi Power Supply</li>
<li>Micro-SD Card</li>
<li>Ethernet Cable</li>
</ul>
<p>The first thing that we will need to do is to go to the <a href="https://www.duckdns.org">DuckDNS website</a>, sign in using your preferred method, once you complete the captcha then you will be given your unique token (copy or take a note of it, but don't share this with anybody).</p>
<p>Next you will want to create your own unique address, type in your chosen domain and click on Add Domain.</p>
<p>Now it is time to setup your Raspberry Pi. Log into your Pi and open a terminal. The first thing that we will do is make sure that it is up to date:</p>
<code>sudo apt update &amp;&amp; sudo apt upgrade -y</code>
<p>Install Curl using the command:</p>
<code>sudo apt install curl</code>
<p>You will now create two new folders, the first is where the script will be kept, the second to store the logs:</p>
<code>sudo mkdir /opt/duckdns/ &amp;&amp; sudo mkdir /var/log/duckdns/</code>
<p>We need to add a bash script that will update your IP with the DuckDNS service. First of all create a new file called duck.sh with the code:</p>
<code>sudo nano /opt/duckdns/duck.sh</code>
<p>At this point the file is empty, we need to enter in the command below. However you must replace <b>DUCKDNSDOMAIN</b> with the domain that was created on the DuckDNS website and replace <b>DUCKTOKEN</b> with your DuckDNS Token:</p>
<code>echo url="https://www.duckdns.org/update?domains=DUCKDNSDOMAIN&amp;token=DUCKTOKEN&amp;ip=" | curl -k -o /var/log/duckdns/duck.log -K -</code>
<p>Now save and exit (ctrl+X, Y, enter on Nano).</p>
<p>Next we can set the script's permission so that nobody else will gain access to your token:</p>
<code>sudo chmod 700 /opt/duckdns/duck.sh</code>
<p>Last step: we need to set a cron task so that your Pi will update DuckDNS domain every 5 minutes:</p>
<code>sudo crontab -e</code>
<p>Navigate to the bottom of the page and add the line:</p>
<code>*/5 * * * * /opt/duckdns/duck.sh &gt;/dev/null 2&gt;&amp;1</code>
<p>Save and exit and your dynamic DNS should be up and running within five minutes.</p>
