Sub topic 8
Registering a domain and delegating it to name servers
This chapter assumes you know the DNS hierarchy (root, TLD, authoritative), the difference between a zone and a name server, and the core record types. You should also be comfortable running dig. The chapter covers who holds a domain registration, what happens when you register or change name servers, and how the parent zone points to your zone.
Three parties, three jobs
Registering a domain involves three roles that are easy to confuse.
| Role | What it is | Example |
|---|---|---|
| Registry | The organization that operates a TLD and keeps its authoritative database of registered names. | Verisign for `.com` |
| Registrar | An accredited company that sells registrations to the public and sends changes to the registry. | Your domain seller |
| Registrant | The person or organization that holds the registration. | You |
You never talk to the registry directly. You change settings at your registrar. The registrar sends those changes to the registry over a protocol called EPP (Extensible Provisioning Protocol). The registry then publishes them in the TLD zone, which is what resolvers actually read.
A registration is a lease, not ownership. You pay for a period, usually 1 to 10 years, and you must renew to keep the name.
What registration actually creates
When you register example.com, three things are stored.
- Registration data at the registry and registrar: the registrant, contacts, creation and expiry dates, and status flags.
- Delegation data in the TLD zone: the NS records that say which name servers are authoritative for your domain.
- Optionally, DS records, which enable DNSSEC. A later chapter covers these.
Only the second item affects how names resolve today. A domain with no NS records in its TLD zone does not resolve at all, however good your own zone file is.
sequenceDiagram
participant R as Registrant
participant G as Registrar
participant Y as Registry (.com)
participant T as .com name servers
R->>G: Register example.com, supply NS names
G->>Y: EPP create domain with NS hosts
Y->>Y: Store registration, update zone data
Y->>T: Publish NS records for example.com
T-->>R: Resolvers now receive a referral to your name serversThe block above is only a picture of the flow. Here is the same flow as a labeled diagram.
Delegation: the NS records in the parent zone
Delegation means the parent zone hands responsibility for a child zone to other name servers. The .com zone does not contain your A or MX records. It contains only NS records that say "ask these servers about example.com".
You can see the delegation by asking a .com server directly, without recursion:
dig +norecurse example.com NS @a.gtld-servers.netThe answer comes back in the AUTHORITY section, not the ANSWER section. That placement marks it as a referral rather than an authoritative answer.
Now compare it with what the child zone says about itself:
dig example.com NS +shortThis usually returns the NS set from your own zone file (served by your name servers, possibly via a cache). The two sets are separate data stored in two places:
- Parent NS set: held by the registry, edited through your registrar.
- Child NS set: held in your zone, edited with your DNS provider.
They should match. If they do not, some resolvers follow one set and some follow the other, which gives intermittent failures that are hard to reproduce.
Glue records
If your name servers live inside the domain they serve, there is a circular problem. To find ns1.example.com you must first ask the servers for example.com, but you need ns1.example.com to do that. The parent zone breaks the loop with glue records: A or AAAA records for the name servers, stored in the parent zone next to the NS records.
; Fragment of the .com zone (held by the registry)
example.com. IN NS ns1.example.com.
example.com. IN NS ns2.example.com.
ns1.example.com. IN A 192.0.2.53
ns2.example.com. IN A 192.0.2.54You create glue at your registrar, usually in a section called "host records", "child name servers", or "private name servers". You need glue only when the name server's hostname is inside the domain being delegated. If you use ns1.dnsprovider.net for example.com, no glue is needed, because the .net zone resolves that name independently.
Looking up registration data
Two systems publish registration data. WHOIS is the older text protocol. RDAP (Registration Data Access Protocol) is the newer one and returns structured JSON over HTTPS.
whois example.com | grep -i -E 'registrar:|status:|name server:|expir'
curl -s https://rdap.org/domain/example.com | head -c 600Since data-privacy rules such as the GDPR took effect, most registrars redact personal contact details in public output. You will still see the registrar, dates, status flags, and name servers. The exact field names differ between registries, so treat the grep above as a starting point.
Status flags and the domain lifecycle
Status flags (EPP statuses) control what can be done to a domain. Two families matter:
- Client statuses (
clientTransferProhibited,clientUpdateProhibited,clientDeleteProhibited) are set by you or your registrar. This is the "registrar lock". - Server statuses (
serverHold,serverTransferProhibited) are set by the registry, often for legal or billing reasons.
clientHold and serverHold are the dangerous ones. They remove the domain's NS records from the TLD zone, so the domain stops resolving everywhere.
After a registration expires, it moves through a lifecycle. Exact lengths differ by TLD and registrar, so check your registrar's policy.
| Stage | Typical behavior |
|---|---|
| Active | Domain works normally until the expiry date. |
| Auto-renew grace period | Often up to about 30 to 45 days. Renewal is still at the normal price, but the domain may stop resolving or show a parking page. |
| Redemption period | Often about 30 days. Recovery is possible but costs a significant extra fee. |
| Pending delete | Around 5 days. The domain cannot be recovered. |
| Released | The name becomes available for anyone to register. |
Changing name servers
You change delegation in your registrar's control panel by replacing the list of name server hostnames. The registrar passes the change to the registry. Typical reasons are moving DNS to your host or to a dedicated DNS provider.
A safe order of work avoids downtime:
- Create the zone at the new provider and copy every record from the old zone, including MX and TXT records. Missing mail records are the most common mistake.
- Check the new provider's name servers directly. Query each one with
dig @newns.provider.net example.com A +shortand compare the output with the old servers. - Lower the TTL on important records in the old zone a day or two ahead, so stale answers expire sooner.
- Change the NS records at the registrar.
- Watch the delegation with
dig +trace example.com. Keep the old zone running until the old NS TTL has passed. - Remove the old zone only when queries to the old servers have stopped.
The step that makes this slow is the NS TTL in the parent. Registries commonly set it high. For .com, delegation records are often cached for 48 hours. During that window, resolvers that cached the old delegation keep asking the old servers. This is why both sets of servers must give correct answers for a while.
dig +trace example.com NS
dig @a.gtld-servers.net example.com NS +norecurse | grep -i -A4 'authority section'Delegating or only adding records
You do not have to move DNS to change where a site points. There are two ways to do it, and they have different trade-offs.
| Approach | What you change | Good for | Watch out for |
|---|---|---|---|
| Delegate to the host's name servers | NS records at the registrar | Hosts that manage DNS for you and want full control | You must recreate all records, including email, at the new provider. |
| Keep DNS where it is | Records (A, CNAME, MX) in the current zone | Mixed setups, such as web at one host and mail at another | The host's IP may change, and a CNAME is not allowed at the zone apex. |
The next chapter covers the second approach in detail. Choose one provider as the single source of truth for your zone. Editing records at a provider whose servers are not in your delegation does nothing, which is a common cause of "my change is not working".
Common delegation problems
- Lame delegation. The parent lists a name server that is not authoritative for the zone, or is down. Resolvers waste time on it, and some queries fail with SERVFAIL. Check each listed server with
dig @server example.com SOA +norecurseand look for theaa(authoritative answer) flag. - Parent and child mismatch. The registrar's NS list differs from the NS records in the zone. Make both match.
- Missing glue. In-domain name servers have no A record at the registrar. The domain fails entirely, since resolvers cannot reach the servers.
- Too few name servers. Registries typically require at least two. Place them on separate networks so one outage does not take the domain offline.
- Transfer problems. To move a domain between registrars you unlock it (remove
clientTransferProhibited), obtain an authorization code (also called an EPP code), and approve the transfer. The domain's name servers do not change during a transfer unless you change them, so DNS keeps working throughout.
Check your understanding
Exercise
You register shop.example and your name servers are ns1.shop.example and ns2.shop.example. The registrar's form accepts the names but the domain does not resolve. What is probably missing, and where must it be added?
Show answer
Glue records. The name servers are inside the domain they serve, so resolvers cannot look them up until the parent (TLD) zone supplies their IP addresses. Add A (and AAAA) records for ns1 and ns2 as host or glue records at the registrar, which passes them to the registry.
Exercise
You changed the NS records at your registrar an hour ago. Some visitors still reach the old server. Why, and when will it stop?
Show answer
Resolvers cached the old delegation from the parent zone. The NS TTL there is often long (about 48 hours for .com), and the old servers keep answering until each resolver's cached copy expires. It stops for each resolver once its cache entry expires, so keep the old zone correct until then.
Exercise
A colleague says dig example.com NS +short returns the correct name servers, so delegation must be fine. What check gives better evidence?
Show answer
Ask a parent-zone server without recursion, for example dig +norecurse example.com NS @a.gtld-servers.net, or run dig +trace example.com. Compare that NS set with the one in your zone. The plain query may return data from your own zone or from a cache, so it does not prove what the registry publishes.