Skip to main content
MotherHosting

How DNS works, in plain words

DNS turns a domain name into the address of a server. Here is the path from domain to nameservers to records to server, and why a change takes time to show everywhere.

MotherHosting 4 min read

Computers find each other by numbers called IP addresses. People remember names. DNS, the Domain Name System, is the directory of the internet that turns a name such as yourbusiness.com into the number of the server that holds the website. When a domain does not open or email stops arriving after a change, DNS is usually the place to look, so it pays to know how the pieces fit.

Four parts, one chain

  1. The domain. The name you registered. The registration itself holds very little: who holds the name, when it expires, and which nameservers answer for it.

  2. The nameservers. The servers that keep the directory page of your domain. There are usually two or more, so that one can answer when another cannot. They are run by your hosting company or by a separate DNS service.

  3. The records. The lines on that page. Each one says: for this name and this kind of question, here is the answer.

  4. The server. The machine the records point to, where your website and mailboxes live.

Domain, nameservers, records, server: if one link in the chain is wrong, the site does not open, even when the other three are perfect.

What happens when someone types your address

The visitor's browser asks a resolver, a helper usually run by their internet provider, where yourbusiness.com is. If the resolver does not know, it first asks the registry of the ending which nameservers answer for the domain. Then it asks one of those nameservers for the record it needs, receives an IP address and hands it to the browser, which connects to your server. All of this takes a fraction of a second. The resolver then remembers the answer for a while, and that detail matters later.

The records you will meet

  • A record. Points a name to the IP address of a server. This is the record that makes the website open. An AAAA record does the same for the newer, longer kind of address.

  • CNAME record. Says that one name is another name for something else. The www in front of a domain is often set up this way.

  • MX record. Says which server receives email for the domain. When it is wrong, the website works and the mail does not arrive.

  • TXT record. A short note that other services read, for example to prove that you own the domain or to say which servers may send email in its name.

  • NS record. Names the nameservers themselves.

Two ways to point a domain

Because of this chain, there are two places where you can change where a domain leads.

  • Change the nameservers. You hand the whole directory page to a new place, and every record is answered from there. This is the simple choice when the domain and the hosting are with the same company. A domain ordered together with hosting at MotherHosting already uses our nameservers and needs nothing else. Keep in mind that records you created at the old nameservers do not travel with the domain; recreate the ones you need at the new place first. See Change your domain's nameservers.

  • Change single records. You keep the nameservers and edit only what matters, usually the A record for the website. This suits a domain whose DNS is managed elsewhere and should stay there. See Point your domain to your hosting.

Why changes take time

Remember that resolvers keep answers for a while. Every record carries a number called TTL, time to live, which says how long an answer may be kept. Until that time runs out, a resolver goes on giving the old answer without asking again.

Resolvers around the world asked at different moments, so their copies run out at different moments. That is why, for a while, the new site opens for you and the old one for your customer, or the other way round. Nothing is travelling slowly; old answers are simply running out one by one.

Record changes often show within minutes and can take up to 24–48 hours to reach everyone. Nameserver changes tend to be the slowest.

A few habits make this easier:

  • Make changes at a quiet time, not an hour before a campaign starts.

  • If you manage your own DNS, lower the TTL of a record a day before a planned change.

  • When you move a site, keep the old server running until the change has reached everyone.

  • Do not switch back and forth while you wait. Every change starts the waiting again.

  • Your own computer and browser remember answers too. Try another network, such as mobile data, before you decide that nothing has changed.

When something does not work

  • Has the domain expired? An expired domain stops answering.

  • Are the nameservers typed correctly? One wrong letter breaks the chain.

  • Did you edit the records at the nameservers the domain really uses? Changing records in a place the domain does not use is a common mistake, and it has no effect at all.

  • Has enough time passed?

If it still does not work, open a support ticket from your account with the domain name and what you changed, and we will look at it with you.

To order, contact us

Tell us the plan or domain you want. We set up your order and send you the invoice.