Sub topic 2
Registering a domain, or using one registered elsewhere
This chapter assumes you know what a DNS query is and the difference between a recursive resolver and an authoritative server (covered in the previous chapter). It also assumes you have an AWS account with the AWS CLI configured and permission to use Route 53 and Route 53 Domains. By the end you will be able to choose between registering a new domain with Route 53, transferring an existing one in, or leaving it at its current registrar and using Route 53 only for DNS. You will also be able to run each path and verify the result.
Three separate roles
Owning a domain involves three roles that are easy to confuse:
- The registry is the organization that operates a top-level domain (TLD), such as Verisign for
.com. It holds the authoritative list of which domains exist and which name servers each one uses. You never deal with it directly. - The registrar is the company accredited to sell domain names and write entries into a registry on your behalf. Route 53 is a registrar, as are GoDaddy, Namecheap and others.
- The DNS service runs the authoritative name servers that answer queries about your records. Route 53 hosted zones are a DNS service.
Route 53 does the registrar and DNS jobs as two separate products. Because they are separate, you can mix them freely: register with Route 53 and host DNS elsewhere, register elsewhere and host DNS in Route 53, or use Route 53 for both.
The link between registrar and DNS service is the set of NS (name server) values stored at the registry. When a resolver asks the .com servers where example.com lives, the registry answers with that list. This is the delegation. A hosted zone also contains its own NS record, but the registry's copy is the one resolvers follow first. If the two lists disagree, you get intermittent failures, which is a common source of confusing outages.
Path 1: Register a new domain with Route 53
Registration works from the console or the CLI. The Route 53 Domains API lives only in the us-east-1 Region, so pass --region us-east-1 for every route53domains command, whatever Region your other resources use.
Check availability and price
Start by asking whether the name is free:
aws route53domains check-domain-availability \
--region us-east-1 \
--domain-name example.comThe response contains an Availability value. The common ones are:
| Value | Meaning |
|---|---|
| `AVAILABLE` | You can register it. |
| `UNAVAILABLE` | Someone else owns it. |
| `UNAVAILABLE_PREMIUM` | It is a premium name that Route 53 does not sell. |
| `RESERVED` | The registry has reserved it. |
| `DONT_KNOW` | The registry did not answer. Try again later. |
Prices differ by TLD. Query them rather than guessing:
aws route53domains list-prices \
--region us-east-1 \
--tld comThe output lists registration, renewal and transfer prices. Renewal is often higher than a promotional first-year price at other registrars, so compare the renewal figure too.
Prepare contact details
ICANN, the body that oversees domain names, requires a registrant, an administrative contact and a technical contact for every domain. Put the details in a JSON file. The phone number must use the +country.number format, for example +1.2065550100.
{
"FirstName": "Alex",
"LastName": "Rivera",
"ContactType": "PERSON",
"AddressLine1": "123 Example Street",
"City": "Seattle",
"State": "WA",
"CountryCode": "US",
"ZipCode": "98101",
"PhoneNumber": "+1.2065550100",
"Email": "[email protected]"
}For a company, set ContactType to COMPANY and add OrganizationName. Some TLDs need extra fields, such as .ca and .es. Check the Route 53 documentation for your TLD before you register.
Register
Replace example.com with a name you want to buy. This command spends real money.
aws route53domains register-domain \
--region us-east-1 \
--domain-name example.com \
--duration-in-years 1 \
--auto-renew \
--admin-contact file://contact.json \
--registrant-contact file://contact.json \
--tech-contact file://contact.json \
--privacy-protect-admin-contact \
--privacy-protect-registrant-contact \
--privacy-protect-tech-contactThe call returns an OperationId. Registration is asynchronous and can take from a few minutes to a few days. Poll it:
aws route53domains get-operation-detail \
--region us-east-1 \
--operation-id OPERATION_IDThe Status moves through SUBMITTED and IN_PROGRESS to SUCCESSFUL, or ends at ERROR or FAILED with a message.
Route 53 also does the following for you when you register:
- It creates a public hosted zone with the same name as the domain. The zone has a monthly fee, separate from the registration fee.
- It sets the four name servers of that zone as the domain's name servers at the registry.
- It turns on auto-renew if you asked for it.
- It enables privacy protection if you asked for it. This replaces your contact details in public WHOIS lookups with proxy values.
Review the domain
aws route53domains get-domain-detail \
--region us-east-1 \
--domain-name example.comLook at Nameservers, AutoRenew, ExpirationDate and StatusList. The status entries are EPP codes. For example, clientTransferProhibited means the transfer lock is on, which is the safe default.
Path 2: Keep the domain at another registrar
You do not have to move a domain to use Route 53 DNS. The registration stays where it is, and only the name server list changes.
- Create a public hosted zone for the domain in Route 53.
- Copy the four name servers from the zone's NS record.
- At the current registrar, replace the existing name servers with those four values.
- Verify the delegation.
The exact commands for steps 1 to 3 appear in the next two chapters, which cover hosted zones and delegation. The point here is the decision. Choose this path when the registrar holds other domains you do not want to split, when a contract or a corporate policy fixes the registrar, or when you only need Route 53's routing and health checks.
The cost of this path is that two consoles manage one domain. Renewals, contact verification and transfer locks stay with the old registrar. If the registration lapses there, DNS in Route 53 stops working however healthy the hosted zone is.
Path 3: Transfer a domain to Route 53
Transferring moves the registration, not the DNS, and the two do not have to move together. To transfer in:
- At the current registrar, unlock the domain and obtain an authorization code (also called an EPP code).
- Confirm the domain is eligible. ICANN blocks transfers within 60 days of a registration or a previous transfer, and not every TLD can be transferred to Route 53.
- Create a hosted zone in Route 53 and recreate every record from the old DNS provider. Do this before the transfer so that answers do not change when name servers switch.
- Start the transfer with
aws route53domains transfer-domain(or in the console) and supply the authorization code, contact details and name servers. - Approve the transfer if the current registrar sends a confirmation email.
Most transfers add one year to the expiration date and take from a few hours to about a week, depending on the TLD and how quickly the old registrar releases the domain. Track progress with get-operation-detail, as for registration.
Registered with Route 53, DNS somewhere else
The reverse case also works. If you register with Route 53 but your DNS is hosted by another provider, replace the name servers at the registry:
aws route53domains update-domain-nameservers \
--region us-east-1 \
--domain-name example.com \
--nameservers Name=ns1.provider.example Name=ns2.provider.exampleThis command works only for domains registered with Route 53. For a domain registered elsewhere, change the name servers at that registrar.
Verify the delegation
Whichever path you used, check what the public DNS returns. dig reads the registry's answer through a recursive resolver:
dig NS example.com +shortThe four values should match the NS record of your hosted zone. To see the registry's own answer without a cache in the way, query a TLD server directly (a.gtld-servers.net is one of the .com servers):
dig @a.gtld-servers.net example.com NS +norecurseThe registry's reply puts the name servers in the authority section, not the answer section. Caching at resolvers means a changed delegation can take up to the TTL of the old NS records to appear everywhere. NS records at the registry commonly have a TTL of 48 hours for .com.
Common errors
- Deleting and recreating a hosted zone. The new zone gets a different set of four name servers, but the registry still lists the old ones. Queries go to servers that no longer hold your zone, and the domain stops resolving. Fix it by running
update-domain-nameservers(or editing the registrar's settings) with the new values. A reusable delegation set avoids this, because you can attach the same name servers to a new zone. - Mismatched NS records. Editing the NS record inside the hosted zone does not change the registry's list. Only the registrar can do that.
- Missing email verification. The domain is suspended after 15 days, as described above.
- Transferring without copying records. If the transfer changes the name servers to an empty hosted zone, the domain goes dark. Recreate the records first.
- Wrong Region. Calling
route53domainsin another Region fails with an endpoint error. Useus-east-1. - Letting auto-renew lapse. An expired domain first enters a grace period, then a redemption period with extra fees, and then it is released. Keep auto-renew on and keep a valid payment method.
Exercise
You registered example.com with another registrar and created a Route 53 hosted zone for it. Records in the zone are correct, but dig NS example.com +short still returns the old provider's name servers. What is missing, and where do you fix it?
Show answer
The delegation at the registry still points to the old name servers. Creating a hosted zone does not change it. Copy the four name servers from the hosted zone's NS record and set them as the domain's name servers at the current registrar. Then wait for the old NS TTL to expire and check again with dig.
Exercise
A teammate deletes the hosted zone for a domain registered with Route 53 and creates a new one with the same name. The records are identical, yet the site no longer resolves. Explain why and give the CLI command family that fixes it.
Show answer
The new hosted zone is assigned a different set of four name servers, but the registry still lists the old ones, so resolvers ask servers that do not hold the zone. Run aws route53domains update-domain-nameservers --region us-east-1 with the new zone's name servers. A reusable delegation set would have kept the name servers the same.