Kamil Gierach-Pacanek
CyberEthical.Me: Hacking for the Security Awareness

CyberEthical.Me: Hacking for the Security Awareness

How to add an Active Zone in Cloudflare

How to add an Active Zone in Cloudflare

Kamil Gierach-Pacanek
ยทOct 13, 2022ยท

3 min read

Subscribe to my newsletter and never miss my upcoming articles

Table of contents

  • What is an Active Zone
  • How to add a new Zone
  • Update nameservers
  • Bonus: Redirect root to subdomain
  • Additional readings

Article contains promotional codes for domain activation and renewal together with SeoHost.pl referral link

On 29th of September 2022, Cloudflare announced a partnership with Yubico offering a great deal for purchasing YubiKeys. It seems like the response of the community was underestimated because they quickly changed the offer, including some requirements before claiming the promotion.

image.png

One of the easiest and possible most impactful for your operations is establishing a Cloudflare Active Zone.

What is an Active Zone

Active Zone is an active domain that was added to your Cloudflare account.

image.png

How to add a new Zone

  1. Navigate to the main dashboard under Websites. image.png
  2. Click Add site. image.png
  3. Enter your site root domain. image.png
  4. Choose "Free" option on the bottom of the page. image.png
  5. Now Cloudflare will scan your existing DNS records, so when you switch your nameservers, previous setting are still in effect. image.png

    At this step almost always you want to proxy all reqests through Cloudflare - because that's the whole idea. But if for some reason you want your subdomain resolution to hit directly to the service server, bypassing Cloudflare proxy - this is the place to specify that.

  6. Click Continue.
  7. You will be welcomed by the overview page where are your Cloudflare nameservers. image.png

Update nameservers

Now, to make your zone active, you have to replace your existing nameservers with those provided by the Cloudflare.

It is important that you remove old ones and leave only Cloudflare's ones, despite the fact it doesn't say so on the overview page (empty Remove these nameservers)

The process varies depending on your registrar/domain provider. Detailed process for most popular registrars is available on Cloudflare Docs. I will show it on example of SeoHost.pl - which services I am using for last couple of years.

Use following codes on checkout:
๐Ÿ’ธ CYBETHME - pay 25% less on domain activation
๐Ÿ’ธ CYBETHMEAGAIN - pay 15% less on domain renewal

  1. Navigate to Domain view. image.png
  2. Select the domain you have added to Cloudflare.
  3. Now in the DNS Setting section, navigate to DNS domain delegations. image.png
  4. Remove all (default) nameservers. Add Cloudflare nameservers. image.png
  5. Click Save.

That's it. After verification process ends on Cloudflare, your website (Zone) should change status from "Pending Nameserver Update" to "Active".

Bonus: Redirect root to subdomain

If you would like to have your root domain to redirect to the subdomain (as it is done with cyberethical.me) you have to take additional steps. It may depend on your original configuration, my registrar was doing that internally by custom rewrite rules.

  1. Navigate to your Zone/Website dashboard on Cloudflare.
  2. Ensure you have CNAME DNS entry for your subdomain. image.png

    Entry may differ depending on your configuration. Attached image is the example of how subdomain blogs words on Hashnode

  3. Ensure you have proxied DNS A record for your root/naked domain. This can be achieved by entering either domain name or @ as a record name with arbitrary IP address and with Proxied status. image.png or image.png

    Arbitrary IP, becasue in the next step we will be adding redirection to a subdomain, so traffic never reaches that IP .

  4. Navigate to Bulk Redirects under Rules. image.png
  5. Click Create a new Bulk Redirects list image.png
  6. Click Create new list image.png
  7. Select Redirect content type, enter name (doesn't really matter). image.png
  8. Click Add item.
  9. Fill entry as shown below. Click Save. image.png

Now, when you enter the naked domain, you should be redirected to the subdomain (with HTTPS).

Additional readings

Did you find this article valuable?

Support Kamil Gierach-Pacanek by becoming a sponsor. Any amount is appreciated!

See recent sponsors |ย Learn more about Hashnode Sponsors
ย 
Share this