<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alecsandru Dinu on Medium]]></title>
        <description><![CDATA[Stories by Alecsandru Dinu on Medium]]></description>
        <link>https://medium.com/@allecsro?source=rss-c60eed649c13------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*ZOaix7Jcr7ivewG-CudZJw.jpeg</url>
            <title>Stories by Alecsandru Dinu on Medium</title>
            <link>https://medium.com/@allecsro?source=rss-c60eed649c13------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 16:10:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@allecsro/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Making a custom DynamicDNS service with Cloudflare Workers]]></title>
            <link>https://medium.com/@allecsro/making-a-custom-dynamicdns-service-with-cloudflare-workers-1aef14c189a4?source=rss-c60eed649c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/1aef14c189a4</guid>
            <category><![CDATA[ddns]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[dynamic-dns]]></category>
            <category><![CDATA[cloudflare-workers]]></category>
            <dc:creator><![CDATA[Alecsandru Dinu]]></dc:creator>
            <pubDate>Fri, 08 May 2020 13:44:03 GMT</pubDate>
            <atom:updated>2020-05-08T13:44:03.751Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*veifkIn1-ndiMx5LSpJPXQ.jpeg" /></figure><p>I have been a long time user of <a href="https://www.cloudflare.com/">Cloudflare</a>, implementing their Web application firewall and DDOS protection services on several of my clients in the past 9 years. So I was very excited to discover their serverless computing solution last year.</p><p>As I was already using their DNS solution, I found the new Workers servlerless the perfect solution for creating my own Dynamic DNS service.</p><p>In case you are wondering what is a DynamicDNS, here is a definition from <a href="https://en.wikipedia.org/wiki/Dynamic_DNS">Wikipedia</a>:</p><blockquote><strong>Dynamic DNS</strong> (<strong>DDNS</strong>) is a method of automatically updating a <a href="https://en.wikipedia.org/wiki/Name_server">name server</a> in the <a href="https://en.wikipedia.org/wiki/Domain_Name_Server">Domain Name Server</a> (DNS), often in real time, with the active DDNS configuration of its configured hostnames, addresses or other information.</blockquote><p>In other words, if you don’t have a static IP from you Internet Service Provider (ISP), then your IP changes each time you connect to the Internet. If you want to expose a service (like an FTP, VPN or HTTP) over the internet you would need to manually update your DNS records every time the IP changes.</p><p>Of course, there are plenty of free or paid DynamicDNS services out there, but if you want to have your own dedicated service, then this article is for you.</p><h3>Setting up Wrangler</h3><p><a href="https://github.com/cloudflare/wrangler">Wrangler</a> is a CLI tool created by <a href="https://www.cloudflare.com/">Cloudflare</a> to help folks create and deploy Cloudflare Workers projects. You could write and deploy a worker project directly from the Cloudflare GUI, but it makes testing and deploying much easier.</p><p>First you would want to install Wrangler and configure on your computer via npm:</p><pre>npm install -g <a href="http://twitter.com/cloudflare/wrangler">@cloudflare/wrangler</a> &amp;&amp; wrangler config</pre><h3>Writing the DDNS app</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bded19565c6f91528547d6c81daa5435/href">https://medium.com/media/bded19565c6f91528547d6c81daa5435/href</a></iframe><h3>Or, use this app fr.</h3><p>Use wrangler to create your Workers app from your Git repository</p><pre>wrangler generate my-app <a href="https://github.com/cloudflare/worker-template">https://github.com/</a>...</pre><p>or you can use my repository</p><pre>wrangler generate my-app <a href="https://github.com/allecsro/cloudflare-ddns">https://github.com/allecsro/cloudflare-ddns</a></pre><p>This will create a bunch of files in a directory my-app. The only change you would need to make is a file named wrangler.toml. Here you must input your Cloudflare Id which you can get from the Cloudflare dashboard.</p><pre>name = &quot;my-app&quot;<br>type = &quot;webpack&quot;<br>account_id = &quot;CLOUDFLARE_ID&quot; # your Cloudflare account ID, this can be found in the Cloudflare dashboard<br>workers_dev = true</pre><h3>Deploy to Cloudflare</h3><p>Before deploying and testing your app, you will need to store a couple of secret texts:</p><ul><li>a salt key used to build a password hash used to authenticate the requests</li><li>the API token key for Cloudflare API</li></ul><p>This can be done via Wrangler or the UI.</p><figure><img alt="Configure environment variables for Cloudflare workers via the UI" src="https://cdn-images-1.medium.com/max/1024/1*ObVN5qgVKLgDGzsHkZeFSg.png" /><figcaption>Configure app secrets via the Cloudflare UI</figcaption></figure><p>If you deploy the app with Wrangler, it’s recommended to use Wrangle for this as well.</p><pre># Enter the secret text which you can access in the script<br>wrangler secret put PRESHARED_SECRET</pre><pre>wrangler secret put API_TOKEN</pre><p>And finally, time to publish the app:</p><pre>wrangler subdomain mydomain<br>wrangler publish</pre><p>You should see an output like the following:</p><pre>⬇️ Installing wranglerjs...<br>⬇️ Installing wasm-pack...<br>✨  Built successfully, built project size is 1 KiB.<br>✨  Successfully published your script to <a href="https://my-app.mydomain.workers.dev/">https://my-app.mydomain.workers.dev</a></pre><p>You can test your new Dynamic DNS via cURL:</p><pre>curl <a href="https://my-app.mydomain.workers.dev/dyndns/update?code=YOUR_PRESHARED_CODE&amp;hostname=HOSTNAME&amp;myip=">https://my-app.mydomain.workers.dev/dyndns/update?code=YOUR_PRESHARED_CODE&amp;hostname=HOSTNAME&amp;myip=</a>....</pre><p>If you get an OK confirmation, then everything is fine, you can go and check the updated DNS record in Cloudflare’s DNS service. Also depending of the model of your router, you can configure your new DDNS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1aef14c189a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>