Parent zone on full setup
When the parent zone is using a full setup1, the steps to set up your child zone depend on whether the subdomain already exists in the parent domain.
If you have not yet created DNS records covering your subdomain in the parent zone:
-
Add the subdomain to a Cloudflare account as a new zone. It can be the same account where the parent zone exists or a different one.
-
Complete the configuration accordingly for full or secondary setup.
-
Get the nameserver names for the subdomain. These can be found within your newly created child zone in DNS > Records ↗, and will not be the same nameservers as the ones used in the parent zone.
-
Within the DNS > Records of the parent zone, add two
NS
records for the subdomain you want to delegate.For example, if you delegated
www.example.com
, you might add the following records toexample.com
:Type Name Content NS
www john.ns.cloudflare.com NS
www melinda.ns.cloudflare.com -
After a few minutes, the child zone will be active.
-
Create the various DNS records needed for your child zone.
-
(Optional) Enable DNSSEC on the child zone.
If you have already created DNS records covering your subdomain in the parent zone:
-
Add the subdomain to a Cloudflare account as a new zone. It can be the same account where the parent zone exists or a different one.
-
Complete the configuration accordingly for full or secondary setup.
-
In your child zone, make sure you have all DNS records that relate to the subdomain. This includes all DNS records deeper than the delegated subdomain. For example, if you are delegating
www.example.com
, you should also move over records forapi.www.example.com
. -
If the parent zone is on Cloudflare, make sure that you migrate over any settings (WAF custom rules, Rules, Workers, and more) that might be needed for the child zone.
-
In the child zone, order an advanced SSL certificate that covers the child subdomain and any deeper subdomains (if present).
-
Get the nameserver names for the subdomain. These can be found within your newly created child zone in DNS > Records ↗, and will not be the same nameservers as the ones used in the parent zone.
-
Within the DNS > Records of the parent zone, update existing address records (
A/AAAA
) on your subdomain toNS
records. If you only have one address record, update the existing one and add a newNS
record. If you have multiple address records, update any two of them.For example, to delegate the subdomain
www.example.com
, the updated records in the parent zoneexample.com
should containNS
records similar to the following:Type Name Content NS
www john.ns.cloudflare.com NS
www adam.ns.cloudflare.com In this example,
john.ns.cloudflare.com
andadam.ns.cloudflare.com
represent the subdomain nameservers that you got from step 6. -
Flush the address records of your subdomain in public resolvers (1.1.1.1 ↗ and 8.8.8.8 ↗).
-
In the DNS > Records of the parent zone, delete all the remaining records on the delegated subdomain, except the
NS
records that you created in step 7.Also delete all DNS records deeper than the delegated subdomain. For example, if you are delegating
www.example.com
, records forapi.www.example.com
should only exist in the new child zone. -
Within a short period of time, the child zone should be active.
-
(Optional) Enable DNSSEC on the child zone.
-
Meaning that Cloudflare is your Authoritative DNS provider. ↩