
<rss version="2.0" 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" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Sat, 04 Apr 2026 10:05:35 GMT</lastBuildDate>
        <item>
            <title><![CDATA[SEO Best Practices with Cloudflare Workers, Part 2: Implementing Subdomains]]></title>
            <link>https://blog.cloudflare.com/subdomains-vs-subdirectories-improved-seo-part-2/</link>
            <pubDate>Fri, 15 Feb 2019 17:09:26 GMT</pubDate>
            <description><![CDATA[ In Part 1, the pros and cons of subdirectories vs subdomains were discussed.  The subdirectory strategy is typically superior to subdomains since subdomains suffer from keyword and backlink dilution.  ]]></description>
            <content:encoded><![CDATA[ 
    <div>
      <h4>Recap</h4>
      <a href="#recap">
        
      </a>
    </div>
    <p>In Part 1, the merits and tradeoffs of <a href="https://blog.cloudflare.com/subdomains-vs-subdirectories-best-practices-workers-part-1/"><i>subdirectories and subdomains</i></a> were discussed.  The subdirectory strategy is typically superior to subdomains because subdomains suffer from <i>keyword</i> and <i>backlink dilution</i>.  The subdirectory strategy more effectively boosts a site's search rankings by ensuring that every keyword is attributed to the root domain instead of diluting across subdomains.</p>
    <div>
      <h4>Subdirectory Strategy without the NGINX</h4>
      <a href="#subdirectory-strategy-without-the-nginx">
        
      </a>
    </div>
    <p>In the first part, our friend Bob set up a hosted Ghost blog at <i>bobtopia.coolghosthost.com</i> that he connected to <i>blog.bobtopia.com</i> using a <code>CNAME</code> DNS record.  But what if he wanted his blog to live at <i>bobtopia.com/blog</i> to gain the SEO advantages of subdirectories?</p><p>A reverse proxy like NGINX is normally needed to route traffic from subdirectories to remotely hosted services.  We'll demonstrate how to implement the subdirectory strategy with Cloudflare Workers and eliminate our dependency on NGINX. (Cloudflare Workers are <a href="https://www.cloudflare.com/learning/serverless/what-is-serverless/">serverless</a> functions that run on the Cloudflare global network.)</p>
    <div>
      <h4>Back to Bobtopia</h4>
      <a href="#back-to-bobtopia">
        
      </a>
    </div>
    <p>Let's write a Worker that proxies traffic from a subdirectory – <i>bobtopia.com/blog –</i> to a remotely hosted platform – <i>bobtopia.coolghosthost.com</i>.  This means that if I go to <i>bobtopia.com/blog</i>, I should see the content of <i>bobtopia.coolghosthost.com,</i> but my browser should still think it's on <i>bobtopia.com</i>.</p>
    <div>
      <h4>Configuration Options</h4>
      <a href="#configuration-options">
        
      </a>
    </div>
    <p>In the <a href="https://dash.cloudflare.com/?zone=workers">Workers</a> editor, we'll start a new script with some basic configuration options.</p>
            <pre><code>// keep track of all our blog endpoints here
const myBlog = {
  hostname: "bobtopia.coolghosthost.com",
  targetSubdirectory: "/articles",
  assetsPathnames: ["/public/", "/assets/"]
}</code></pre>
            <p>The script will proxy traffic from <code>myBlog.targetSubdirectory</code> to Bob's hosted Ghost endpoint, <code>myBlog.hostname</code>.  We'll talk about <code>myBlog.assetsPathnames</code> a little later.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4euHWaCm0YKJDnMpWIsFy9/90cb71bf33f1637863413a04af86f5e4/Screen-Shot-2019-01-27-at-2.47.39-PM.png" />
            
            </figure><p>Requests are proxied from bobtopia.com/articles to bobtopia.coolghosthost.com (Uh oh... is because the hosted Ghost blog doesn't actually exist)</p>
    <div>
      <h4>Request Handlers</h4>
      <a href="#request-handlers">
        
      </a>
    </div>
    <p>Next, we'll add a request handler:</p>
            <pre><code>async function handleRequest(request) {
  return fetch(request)
}

addEventListener("fetch", event =&gt; {
  event.respondWith(handleRequest(event.request))
})</code></pre>
            <p>So far we're just passing requests through <code>handleRequest</code> unmodified.  Let's make it do something:</p>
            <pre><code>
async function handleRequest(request) { 
  ...

  // if the request is for blog html, get it
  if (requestMatches(myBlog.targetSubdirectory)) {
    console.log("this is a request for a blog document", parsedUrl.pathname)
    const targetPath = formatPath(parsedUrl)
    
    return fetch(`https://${myBlog.hostname}/${targetPath}`)
  }

  ...
  
  console.log("this is a request to my root domain", parsedUrl.pathname)
  // if its not a request blog related stuff, do nothing
  return fetch(request)
}

addEventListener("fetch", event =&gt; {
  event.respondWith(handleRequest(event.request))
})</code></pre>
            <p>In the above code, we added a conditional statement to handle traffic to <code>myBlog.targetSubdirectory</code>.  Note that we've omitted our helper functions here.  The relevant code lives inside the <code>if</code> block near the top of the function. The <code>requestMatches</code> helper checks if the incoming request contains <code>targetSubdirectory</code>.  If it does, a request is made to <code>myBlog.hostname</code> to fetch the HTML document which is returned to the browser.</p><p>When the browser parses the HTML, it makes additional asset requests required by the document (think images, stylesheets, and scripts).  We'll need another conditional statement to handle these kinds of requests.</p>
            <pre><code>// if its blog assets, get them
if ([myBlog.assetsPathnames].some(requestMatches)) {
    console.log("this is a request for blog assets", parsedUrl.pathname)
    const assetUrl = request.url.replace(parsedUrl.hostname, myBlog.hostname);

    return fetch(assetUrl)
  }</code></pre>
            <p>This similarly shaped block checks if the request matches any pathnames enumerated in <code>myBlog.assetPathnames</code> and fetches the assets required to fully render the page.  Assets happen to live in <i>/public</i> and <i>/assets</i> on a Ghost blog.  You'll be able to identify your assets directories when you <code>fetch</code> the HTML and see logs for scripts, images, and stylesheets.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/333FXL8DTk3xbnNH3CDM2G/9818beae76d36f64663d71a99e41fcb1/Screen-Shot-2019-01-27-at-5.51.44-PM.png" />
            
            </figure><p>Logs show the various scripts and stylesheets required by Ghost live in <i>/assets</i> and <i>/public</i></p><p>The full script with helper functions included is:</p>
            <pre><code>
// keep track of all our blog endpoints here
const myBlog = {
  hostname: "bobtopia.coolghosthost.com",
  targetSubdirectory: "/articles",
  assetsPathnames: ["/public/", "/assets/"]
}

async function handleRequest(request) {
  // returns an empty string or a path if one exists
  const formatPath = (url) =&gt; {
    const pruned = url.pathname.split("/").filter(part =&gt; part)
    return pruned &amp;&amp; pruned.length &gt; 1 ? `${pruned.join("/")}` : ""
  }
  
  const parsedUrl = new URL(request.url)
  const requestMatches = match =&gt; new RegExp(match).test(parsedUrl.pathname)
  
  // if its blog html, get it
  if (requestMatches(myBlog.targetSubdirectory)) {
    console.log("this is a request for a blog document", parsedUrl.pathname)
    const targetPath = formatPath(parsedUrl)
    
    return fetch(`https://${myBlog.hostname}/${targetPath}`)
  }
  
  // if its blog assets, get them
  if ([myBlog.assetsPathnames].some(requestMatches)) {
    console.log("this is a request for blog assets", parsedUrl.pathname)
    const assetUrl = request.url.replace(parsedUrl.hostname, myBlog.hostname);

    return fetch(assetUrl)
  }

  console.log("this is a request to my root domain", parsedUrl.host, parsedUrl.pathname);
  // if its not a request blog related stuff, do nothing
  return fetch(request)
}

addEventListener("fetch", event =&gt; {
  event.respondWith(handleRequest(event.request))
})</code></pre>
            
    <div>
      <h4>Caveat</h4>
      <a href="#caveat">
        
      </a>
    </div>
    <p>There is one important caveat about the current implementation that bears mentioning. This script will not work if your hosted service assets are stored in a folder that shares a name with a route on your root domain.  For example, if you're serving assets from the root directory of your hosted service, any request made to the <i>bobtopia.com</i> home page will be masked by these asset requests, and the home page won't load.</p><p>The solution here involves modifying the blog assets block to handle asset requests without using paths.  I'll leave it to the reader to solve this, but a more general solution might involve changing <code>myBlog.assetPathnames</code> to <code>myBlog.assetFileExtensions</code>, which is a list of all asset file extensions (like .png and .css).  Then, the assets block would handle requests that contain <code>assetFileExtensions</code> instead of <code>assetPathnames</code>.</p>
    <div>
      <h4>Conclusion</h4>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>Bob is now enjoying the same SEO advantages as Alice after converting his subdomains to subdirectories using Cloudflare Workers.  Bobs of the world, rejoice!</p><hr /><p>Interested in deploying a Cloudflare Worker without setting up a domain on Cloudflare? We’re making it easier to get started building serverless applications with custom subdomains on <a href="https://workers.dev">workers.dev</a>. <i>If you’re already a Cloudflare customer, you can add Workers to your existing website</i> <a href="https://dash.cloudflare.com/workers"><i>here</i></a>.</p><p><a href="https://workers.dev">Reserve a workers.dev subdomain</a></p><hr /><p></p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[SEO]]></category>
            <category><![CDATA[NGINX]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">btWeOWsm3GJicWtFI691s</guid>
            <dc:creator>Michael Pinter</dc:creator>
        </item>
        <item>
            <title><![CDATA[SEO Best Practices with Cloudflare Workers, Part 1: Subdomain vs. Subdirectory]]></title>
            <link>https://blog.cloudflare.com/subdomains-vs-subdirectories-best-practices-workers-part-1/</link>
            <pubDate>Fri, 15 Feb 2019 17:09:05 GMT</pubDate>
            <description><![CDATA[ Alice and Bob are budding blogger buddies who met up at a meetup and purchased some root domains to start writing.  Alice bought aliceblogs.com and Bob scooped up bobtopia.com. ]]></description>
            <content:encoded><![CDATA[ 
    <div>
      <h4>Subdomain vs. Subdirectory: 2 Different SEO Strategies</h4>
      <a href="#subdomain-vs-subdirectory-2-different-seo-strategies">
        
      </a>
    </div>
    <p>Alice and Bob are budding blogger buddies who met up at a meetup and <a href="https://www.cloudflare.com/products/registrar/"><i>purchased some root domains</i></a> to start writing.  Alice bought <i>aliceblogs.com</i> and Bob scooped up <i>bobtopia.com</i>.</p><p>Alice and Bob decided against WordPress because its what their parents use and purchased subscriptions to a popular cloud-based Ghost blogging platform instead.</p><p>Bob decides his blog should live at at blog.bobtopia.com – a <i>subdomain</i> of bobtopia.com. Alice keeps it old school and builds hers at <i>aliceblogs.com/blog</i> – a <i>subdirectory</i> of aliceblogs.com.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4bfADYO8jfROjJXl42KfXV/d7722e13418b6568bedfa1501c17e626/Untitled-1-1.png" />
            
            </figure><p><i>Subdomains</i> and <i>subdirectories</i> are different strategies for instrumenting root domains with new features (think a blog or a storefront).  Alice and Bob chose their strategies on a whim, but <i>which strategy is technically better</i>?  The short answer is, <i>it depends</i>. But the long answer can actually improve your SEO.  In this article, we'll review the merits and tradeoffs of each. In <a href="/subdomains-vs-subdirectories-improved-seo-part-2/">Part 2</a>, we'll show you how to convert subdomains to subdirectories using <a href="www.cloudflare.com/workers">Cloudflare Workers</a>.</p>
    <div>
      <h4>Setting Up Subdomains and Subdirectories</h4>
      <a href="#setting-up-subdomains-and-subdirectories">
        
      </a>
    </div>
    <p>Setting up subdirectories is trivial on basic websites.  A web server treats its subdirectories (aka subfolders) the same as regular old folders in a file system.  In other words, basic sites are already organized using subdirectories out of the box.  No set up or configuration is required.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/Rsiz813gZMirbUtjKPo1H/8d097bb447c0874bd9dcc9325ab3930f/Screen-Shot-2019-01-22-at-4.07.02-PM.png" />
            
            </figure><p>In the old school site above, we'll assume the <i>blog</i> folder contains an <i>index.html</i> file. The web server renders <i>blog/index.html</i> when a user navigates to the <i>oldschoolsite.com/blog</i> subdirectory_._  But Alice and Bob's sites don't have a <i>blog</i> folder because their blogs are hosted remotely – so this approach won't work.</p><p>On the modern Internet, subdirectory setup is more complicated because the services that comprise a root domain are often hosted on machines scattered across the world.</p><p>Because DNS records only operate on the domain level, records like <code>CNAME</code> have no effect on a url like <i>aliceblogs.com/blog</i> – and because her blog is hosted remotely, Alice needs to install <a href="https://www.nginx.com/">NGINX</a> or another reverse proxy and write some configuration code that proxies traffic from <i>aliceblogs.com/blog</i> to her hosted blog. It takes time, patience, and experience to connect her domain to her hosted blog.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5280nHa1SMYG1xAwGUYWDa/844e384aa3c5851c36a6218982aada0c/Screen-Shot-2019-02-05-at-8.25.01-PM.png" />
            
            </figure><p>A location block in NGINX is necessary to proxy traffic from a subdirectory to a remote host</p><p>Bob's subdomain strategy is the easier approach with his remotely hosted blog.  A DNS <code>CNAME</code> record is often all that's required to connect Bob's blog to his subdomain.  No additional configuration is needed if he can remember to pay his monthly subscription.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6kWlWnq3CzsVQIk5POm8DJ/b945ad38484de1f5f46abb950da40b4a/Screen-Shot-2019-02-11-at-10.57.06-AM.png" />
            
            </figure><p>Configuring a DNS record to point a hosted service at your blog subdomain</p><p>To recap, subdirectories are already built into simple sites that serve structured content from the same machine, but modern sites often rely on various remote services.  Subdomain set up is comparatively easy for sites that take advantage of various hosted cloud-based platforms.</p>
    <div>
      <h4>Are Subdomains or Subdirectories Better for SEO?</h4>
      <a href="#are-subdomains-or-subdirectories-better-for-seo">
        
      </a>
    </div>
    <p>Subdomains are neat. If you ask me, <i>blog.bobtopia.com</i> is more appealing than <i>bobtopia.com/blog</i>. But if we want to make an informed decision about the best strategy, where do we look?  If we're interested in SEO, we ought to consult the Google Bot.</p><p>Subdomains and subdirectories are equal in the eyes of the Google Bot, according to Google itself.  This means that Alice and Bob have the same chance at ranking in search results.  This is because Alice's root domain and Bob's subdomain build their own sets of <i>keywords</i>.  Relevant keywords help your audience find your site in a search. There is one important caveat to point out for Bob:</p><blockquote><p>A subdomain is equal and distinct from a root domain.  This means that a subdomain's keywords are treated separately from the root domain.</p></blockquote><p>What does this mean for Bob?  Let's imagine <i>bobtopia.com</i> is already a popular online platform for folks named Bob to seek kinship with other Bobs.  In this peculiar world, searches that rank for <i>bobtopia.com</i> wouldn't automatically rank for <i>blog.bobtopia.com</i> because each domain has its own separate keywords.  The lesson here is that keywords are diluted across subdomains.  Each additional subdomain decreases the likelihood that any particular domain ranks in a given search.  A high ranking subdomain does not imply your root domain ranks well.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7KQm8LGoY1UrmNc6Nlwmz0/82706de305fd0243ff593202731d31eb/Untitled-Diagram.png" />
            
            </figure><p>In a search for "Cool Blog", <i>bobtopia.com</i> suffers from <i>keyword dilution.</i> It doesn't rank because its blog keyword is owned by <i>blog.bobtopia.com</i>.</p><p>Subdomains also suffer from <i>backlink dilution.</i>  A <i>backlink</i> is simply a hyperlink that points back to your site. Alice's attribution to a post on the etymology of Bob from <i>blog.bobtopia.com</i> does not help <i>bobtopia.com</i> because the subdomain is treated separate but equal from the root domain.  If Bob used subdirectories instead, Bob's blog posts would feed the authority of <i>bobtopia.com</i> and Bobs everywhere would rejoice.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/69iuli3pGl8aIxAYNY7FVg/f35165a5417dc18278435bcf13e6aa91/Untitled-Diagram--2-.png" />
            
            </figure><p>The authority of <i>blog.bobtopia.com</i> is increased when Alice links to Bob's interesting blog post, but the authority of <i>bobtopia.com</i> is not affected.</p><p>Although search engines have improved at identifying subdomains and attributing keywords back to the root domain, they still have a long way to go.  A prudent marketer would avoid risk by assuming search engines will always be bad at cataloguing subdomains.</p><p>So when would you want to use subdomains?  A good use case is for companies who are interested in expanding into foreign markets.  Pretend <i>bobtopia.com</i> is an American company whose website is in English.  Their English keywords won't rank well in German searches – so they translate their site into German to begin building new keywords on <i>deutsch.bobtopia.com</i>. Erfolg!</p><p>Other use cases for subdomains include product stratification (think global brands with presence across many markets) and corporate internal tools (think productivity and organization tools that aren't user facing).  But unless you're a huge corporation or just finished your Series C round of funding, subdomaining your site into many silos is not helping your SEO.</p>
    <div>
      <h4>Conclusion</h4>
      <a href="#conclusion">
        
      </a>
    </div>
    <p>If you're a startup or small business looking to optimize your SEO, consider subdirectories over subdomains.  Boosting the authority of your root domain should be a universal goal of any organization. The subdirectory strategy concentrates your keywords onto a single domain while the subdomain strategy spreads your keywords across multiple distinct domains. In a word, the subdirectory strategy results in better root domain authority. Higher domain authority leads to better search rankings which translates to more engagement.</p><p>Consider the multitude of disruptive PaaS startups with <i>docs.disruptivepaas.com</i> and <i>blog.disruptivepaas.com</i>.  Why not switch to <i>disruptivepaas.com/docs</i> and <i>disruptivepaas.com/blog</i> to boost the authority of your root domain with all those docs searches and StackOverflow backlinks?</p>
    <div>
      <h4>Want to Switch Your Subdomains to Subdirectories?</h4>
      <a href="#want-to-switch-your-subdomains-to-subdirectories">
        
      </a>
    </div>
    <p>Interested in switching your subdomains to subdirectories without a reverse proxy? In <a href="/subdomains-vs-subdirectories-improved-seo-part-2/">Part 2</a>, we'll show you how using Cloudflare Workers.</p><hr /><p>Interested in deploying a Cloudflare Worker without setting up a domain on Cloudflare? We’re making it easier to get started building serverless applications with custom subdomains on <a href="https://workers.dev">workers.dev</a>. <i>If you’re already a Cloudflare customer, you can add Workers to your existing website</i> <a href="https://dash.cloudflare.com/workers"><i>here</i></a>.</p><p><a href="https://workers.dev">Reserve a workers.dev subdomain</a></p><hr /><p></p> ]]></content:encoded>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[SEO]]></category>
            <category><![CDATA[NGINX]]></category>
            <category><![CDATA[Serverless]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">2bz363mDKlEfN0RypJoRjr</guid>
            <dc:creator>Michael Pinter</dc:creator>
        </item>
        <item>
            <title><![CDATA[Managing DNS Records For The People With Cloudflare Apps]]></title>
            <link>https://blog.cloudflare.com/managing-dns-records-for-the-people-with-cloudflare-apps/</link>
            <pubDate>Fri, 14 Dec 2018 13:00:00 GMT</pubDate>
            <description><![CDATA[ DNS records are hard.  Many people, even the technically competent, don’t bother to learn more than the basics.  Let Cloudflare Apps manage them for you. ]]></description>
            <content:encoded><![CDATA[ <p>DNS records are hard.  Many people, even the technically competent, don’t understand more than the basics.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2BNUOdCDAKCprD7JjTmFyJ/14dc300ae61602fc38b8824a4f77d3d4/oj1wkqP-2.jpg" />
            
            </figure><p>I'll speak for myself — as someone who always learned just enough about DNS to get it working, then immediately forgot everything until the next time it broke. It was a vicious cycle until I convinced myself to learn it in depth.  Meanwhile, non-technical folks wisely avoid meddling in such dangerous affairs all together.</p><p>Surely, there must be a better way (this is a blog post after all).</p><p>Every day, thousands of Cloudflare users add DNS records to their Internet properties to configure awesome tools like G Suite, Shopify, Wordpress, Ghost, and thousands of others.  A new Cloudflare Apps feature allows apps to <i>automatically set up and manage configurable DNS records</i> on more than 12 million registered domains on the Cloudflare network. In short, Cloudflare Apps are here to alleviate the Internet’s collective DNS woes.</p><p>Gone are the days of tribulating over whether it’s <code>A</code> or <code>CNAME</code> you should set.  Gone are the days of puzzling between <code>A</code> and <code>AAAA</code> records while wondering what the heck happened to <code>AA</code> and <code>AAA</code> records?  Unload your DNS dysphoria onto highly trained developers experienced at explicating these burdensome questions today!</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1TN3eQzdxYjWNti7lhW5Yy/33b375d3bc08c9d9c71c3413b29b3cf8/48380631_342147089944308_3701425961271558144_n.png" />
            
            </figure><p>Did you know?</p><p>Are you a highly trained developer?  Cloudflare now provides the tools to build robust, powerful apps that automate DNS record management saving countless developer hours that are currently spent fiddling with DNS.  Instead of manually configuring records to integrate with your solution provider, build a Cloudflare App that does it for you and <i>for everyone else on the Internet</i>.</p><p><a href="https://www.cloudflare.com/apps/pointless-dns-app">Pointless DNS</a> is a demo app that showcases the new DNS feature by installing a (pointless) <code>TXT</code> record on any root or subdomain of your choice.  The <code>TXT</code> record is configured and managed by the Pointless DNS app.  Go ahead and <a href="https://www.cloudflare.com/apps/uJ2Lfocw919J/install?version=1.0.2">install it</a> to see automated DNS record management with Cloudflare Apps.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7HWXhj18dbUik6DYmtzFWR/47f5b3ec49922c92e727bce382382461/Screen-Shot-2018-12-13-at-2.01.13-PM.png" />
            
            </figure><p>The TXT record name was set to "blog" during installation</p><p>After installation, head over to your <a href="https://dash.cloudflare.com/?zone=dns">DNS dashboard</a> and you'll see the app doing its thing.  If you really want to, you can uninstall it from your <a href="https://dash.cloudflare.com/?zone=apps/installed-apps">Installed Apps</a> page.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4yp3qzIBrOThljl9JBIE5Y/ca85d8d78d15758d3e58658c672c5961/dnsrecord.png" />
            
            </figure><p>Pointless DNS automatically manages its TXT record on my blog subdomain</p><p>To start building your own DNS app, download <a href="https://github.com/cloudflare-apps/create-cloudflare-app">create-cloudflare-app</a> and open it in your preferred text editor.  Below, I’ll explain how Pointless DNS manages its configurable <code>TXT</code> record.</p><p>In the <code>install.json</code> file, you’ll find a <code>dns</code> field that looks like this:</p>
            <pre><code># install.json

"dns": [{
    "type": "TXT",
    "content": "Managed TXT Record",
    "name": "Created by create-cloudflare-app",
    "ttl": 120
  }]</code></pre>
            <p>This says a <code>TXT</code> record will be set up and managed on the app installer's site, which can only be modified or deleted through the app’s configuration page.  Apps can create or modify any type of Cloudflare DNS record available in Cloudflare's <a href="https://api.cloudflare.com/#dns-records-for-a-zone-create-dns-record">DNS API</a>.</p><p>Now let's add in some configuration. Add an install option and point it at your record — <code>options.subdomain</code> will be set to the installer's desire.</p>
            <pre><code># install.json

{
  "options": {
    "properties": {
      "subdomain": {
        "order": 1,
        "type": "string",
        "title": "TXT Record Subdomain",
        "description": "The subdomain of your DNS record",
        "placeholder": "*Required - e.g. [your_domain].com",
        "required": true
      }
    }
  },
  "dns": [{
    "type": "TXT",
    "name": "{{options.subdomain}}",
    "content": "{{options.subdomain}} was set"
  }]
}</code></pre>
            <p>That's all there is to it.  Check out the Cloudflare Apps <a href="https://www.cloudflare.com/apps/developer/docs/dns">docs</a> to learn more about about building DNS apps.  For additional inspiration, consider <a href="https://www.cloudflare.com/apps/mailchannels">Mailchannels</a> — a powerful <a href="https://www.cloudflare.com/zero-trust/products/email-security/">email security solution</a> that manages DNS records to fight off pesky spammers and phishermen.</p>
            <figure>
            
            <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7AzbUOvIrjUh1J4JEoIFew/109aa50d4bbab4f6d1729a1cc38050c8/unnamed.png" />
            
            </figure><p>Woof!</p><p>DNS records used to be hard, but a new breed of Cloudflare Apps makes them <i>easy</i>.  Cloudflare Apps-based automated DNS configuration gives developers the opportunity to be the hero people want <i>and</i> the hero they need.</p><p><i>NOTE: This post was updated 5 hours after initial publication to include additional, relevant details.</i></p> ]]></content:encoded>
            <category><![CDATA[DNS]]></category>
            <category><![CDATA[Cloudflare Apps]]></category>
            <category><![CDATA[Speed & Reliability]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">2eWRUE7pYbMXswKxKYflHk</guid>
            <dc:creator>Michael Pinter</dc:creator>
        </item>
    </channel>
</rss>