When creating this blog, I did quite a bit of configuration in Cloudflare Pages to get DNS working with this domain, but I failed to document any of it. I’ve got a new blog KD0FAB Amateur Radio on a new domain, so I’m going to try to document the configuration process here so I don’t have to fumble about (as much) for the next domain.

For the most part, I followed a tutorial at Smaller Fish. This post is going to document some details left out and any changes from that process.

The first bit of extra detail is in step 4a. The Cloudflare wizard wants you to create some DNS records for a domain, but that can be done later. Cloudflare does warn you about this, but you can continue to the next step, which specifies the Cloudflare nameservers you need to change at the domain registrar.

Step 4b can be followed as is, at least as of the date of this post.

Step 4c, configuring a customer domain, is where we will add the DNS records we skipped earlier. The Cloudflare wizard creates an initial CNAME record pointing to your project. Many of the pages involving DNS configuration warn about updates taking up to 48 hours to take effect, but so far I’ve been lucky and haven’t had to wait more than a few minutes.

The rest of the tutorial involves more use of Hugo, which is fairly straightforward.

Now that I’m documenting this in “real time”, I recall one of the problems I had in the initial setup of this domain. Following along with the tutorial, you should eventually be able to navigate to your new site (in this case, kd0fab.radio) in a browser. But, trying to go to www.kd0fab.radio will not work. I need to add another CNAME record.

Back in the Cloudflare account home, go to the “Websites” section, and choose the site that was created earlier. On the right of the page, under “Quick Actions”, choose “DNS Settings”. At the top of the page, there may be a helpful hint to add a record for the www version of the domain. I either missed that the first time around, or the hints are relatively new. Regardless, that’s exactly what we want to do, so click on the “Add record” button, and enter www.<domain name> under “Name”. For “Target”, use the same value the root domain is configured for; likely something like <project name>.pages.dev. This one may take longer to get through the DNS system.

UPDATE 2023-04-24: It turns out that while I was correct in having to add another CNAME, the path I took to do that was not correct, at least for Cloudflare Pages projects. When trying to bring up the www subdomain in a browser, I was presented with a Cloudflare error page for a 522 HTTP status. Luckily, they include a link to troubleshooting steps, which eventually lead me back to the instructions for adding a customer domain to my project. There’s probably some Cloudflare magic going on behind the scenes, as the DNS CNAME record the wizard produced looked the same as the one I had initially added manually.