Domain Course, Module 5 of 9. Reading time: about 9 minutes, followed by three practice questions.
This module explains what DNS does, what the most common DNS records are for, and how to avoid breaking the website or company email when a record is changed.
The Situation
A marketing coordinator signs up for a new email newsletter service. The setup instructions say to “update your DNS records,” and list several entries.
The coordinator has a login for the company’s DNS provider. One of the existing records looks similar to one in the instructions, so the coordinator replaces it with the new value and saves the change.
The newsletter service now works. By the afternoon, employees notice that no outside email has arrived for hours. The record that was replaced was the one that told the internet where to deliver the company’s mail.
What DNS Does
DNS (Domain Name System) translates a domain name that people can read, such as example.com, into the numeric addresses that computers use to find each other. It is often compared to a contact list: a person looks up a name, and the list supplies the number.
Every time someone visits a website or sends an email, a DNS lookup happens first.
The answers that DNS gives come from a set of entries called DNS records. Each record has a type, a name, and a value.
Nameservers: The Setting That Controls Everything Else
Nameservers are the servers that hold a domain name’s DNS records and answer lookups for it. The nameserver setting, which is recorded at the registrar, says which provider is in charge of the domain name’s DNS.
This is the most consequential DNS setting. Changing the nameservers does not change one record. It replaces the entire set of records with whatever exists at the new provider. If the new provider has no records for email, email stops.
DNS is not always managed at the registrar. A company may register its domain name at one provider and manage its DNS records at another. The domain inventory from Module 2 should record both.
The Common Record Types
Six record types cover nearly everything a non-specialist will encounter. The example values below use reserved documentation addresses and invented provider names.
| Record | What it does | Example value | What breaks if it is wrong |
|---|---|---|---|
| A | Points a name at the numeric address of a server. | 203.0.113.10 |
The website does not load, or loads from the wrong server. |
| AAAA | Does the same job as an A record, for the newer and longer address format. | 2001:db8::10 |
Some visitors cannot reach the website. |
| CNAME | Points one name at another name. Common for “www” and for third-party services. | shops.example-platform.com |
The subdomain or connected service stops working. |
| MX (mail exchanger) | Says which servers accept email for the domain name. | 10 mail.example-provider.com |
Incoming email bounces or disappears. |
| TXT | Holds text, used for verification codes and for email authentication. | v=spf1 include:_spf.example-provider.com ~all |
Outgoing email is marked as spam, or a connected service loses its verification. |
| NS (nameserver) | Says which nameservers are in charge of the domain name. | ns1.example-dns.com |
Everything can stop at once. |
A domain name normally has several records of the same type. A company can have many TXT records and more than one MX record. This is why “replace the existing record” is rarely the correct reading of a setup instruction. In most cases the instruction means “add this record alongside the others.”
TTL: Why Changes Are Not Instant
Every DNS record has a TTL (time to live), which is the length of time other systems are allowed to remember the answer before asking again. A TTL is expressed in seconds. A TTL of 3600 is one hour.
Two consequences follow. A change can take time to be seen everywhere, because some systems are still using the remembered answer. A mistake can also take time to be undone everywhere, for the same reason. “It works for me but not for the customer” is frequently a TTL effect.
Change Control: Five Habits
Most DNS outages are caused by well-intended changes. Five habits prevent nearly all of them.
- Record the current state first. Take a screenshot or export the records before changing anything.
- Add, do not replace, unless the instruction clearly says to replace. When in doubt, ask.
- Make one change at a time. If something breaks, the cause is obvious.
- Confirm the result. Check that the website loads and that email arrives from an outside address.
- Never delete a record because it is unfamiliar. An unrecognized record is usually doing a job somebody forgot to write down.
In the scenario above, the first two habits would have prevented the outage, and the first would have made the repair a one-minute task.
Forgotten Records
Records are easy to add and easy to forget. A company sets up a subdomain for a campaign, points it at an outside service with a CNAME record, and later cancels the service. The record remains.
This matters because the record still points to the outside service. If someone else can claim the abandoned name at that service, that person can publish content on the company’s subdomain. This is known as a subdomain takeover. The defense is to remove a DNS record when the service behind it is canceled, and to review the full list of records at least once a year.
Key Points
- DNS translates a domain name into the addresses computers use. Every website visit and every email depends on it.
- The nameserver setting decides which provider controls all of the domain name’s records.
- A and AAAA records point at servers, CNAME records point at other names, MX records direct email, and TXT records hold verification and email authentication text.
- Changes take time to spread because of TTL.
- Record the current state, add instead of replacing, change one thing at a time, confirm the result, and never delete an unfamiliar record.
Check Your Understanding
These three practice questions are not graded or recorded. Choose an answer for each question, then select “Check my answers.”