How to Delegate a Subdomain to Another DNS Provider
Keep your main DNS zone in place while delegating a subdomain. Prepare the child zone, add parent NS records, and test referrals, glue and DNSSEC.
- dns
- subdomains
- nameservers
- guide
To delegate a subdomain, create the child zone on the new provider. Then publish NS records for the subdomain in the parent zone. For example, a product team can manage docs.example.com on its own DNS provider while the main IT team continues to manage example.com.
Prepare the child before adding a referral
At the receiving provider, create the zone for docs.example.com and note its assigned authoritative nameservers. Load the web records and other services under that name, including existing TXT or mail records if anyone uses them. Copying records without testing the new provider can leave the name delegated to a server that cannot answer.
Query each assigned server directly before changing the parent. For a placeholder provider nameserver, try dig @ns1.dns-provider.example docs.example.com SOA +norecurse. The child should answer authoritatively. Also query a real host or service record within the child. Repeat on every assigned server.
Put the records on the correct side of the zone cut
| Control point | What belongs there |
|---|---|
Parent example.com zone | NS records at the name docs.example.com, pointing to the assigned child nameservers. |
Child docs.example.com zone | The child's SOA and authoritative NS set, plus the records for its services. |
| Parent for an in-domain server | Glue address information when a nameserver such as ns1.docs.example.com must be reached before the child can answer. |
| Parent for a signed child | A DS record if you intend to establish a DNSSEC chain and have the correct data for the child's active key. |
You normally do not need glue in your parent for provider hostnames under a different domain. Those can resolve independently. RFC 9471 explains glue in delegation responses. Keep the parent referral and the child NS set consistent. If you will roll out DNSSEC, verify that the child serves valid signatures before publishing the DS.
Test the referral as well as the destination
Ask an authoritative server for the parent about a host within the child, using a non-recursive query. Check the referral for the intended child servers. Then ask each child server directly and check an ordinary recursive result from outside your network. If the parent points to the right servers and the child does not answer, investigate the child configuration. If the child answers directly but recursive lookups fail, check the referral, glue and any DS data.
Record the previous parent configuration and child data so you can recover the existing service if needed. A change at a subdomain's zone cut should not require moving the entire parent domain at the registrar.
