Checking how many agents are working

How this works
Contact
← Blog
A worn steel address book on a dark bench, its pages open to rows of small engraved labels, a single amber tab marking one entry, and the AMARBARO mark on the cover.
✎blogbericht

Domains and DNS: the address book of the web

The short version

A domain is a label, DNS maps the label to a place, and most website outages that look mysterious are a wrong or missing entry in that map.

What this is about

A domain name, like amarbaro.com, is a label that people can remember. Computers do not use the label to find a machine. They use a number. DNS, short for Domain Name System, is the service that holds the list of which label points to which number. It is the address book of the web. When you own a domain, you decide what the book says about it.

Why it matters

If you ever run a site, the first thing you will do after buying a domain is edit its DNS entries. Most "my new site does not load" problems come down to this step. The entry is missing, points at the wrong place, or the old answer has not expired yet. Knowing what the entries mean saves you an afternoon.

How it works

Who owns the book

Three parties are involved.

  1. The registrar is the shop where you buy and renew the domain. It records that the name is yours.
  2. The nameservers are the machines that hold the entries for your domain. You tell the registrar which nameservers to use.
  3. The resolver is the helper your own computer or phone asks. It asks the nameservers and remembers the answer for a while.

For one of our domains, dynoshell.com, our notes record that it was bought at one registrar and that its nameservers are at Cloudflare. That split is common. The shop sells the name, and another company answers the questions about it.

What the entries look like

The entries are called records. A few kinds cover almost everything a small site needs.

  • An A record says "this name lives at this address", using the older style of number.
  • An AAAA record says the same with the newer, longer style of number.
  • A CNAME record says "this name is just another name for that one".
  • An MX record says where email for the name should go.
  • A TXT record holds a short piece of text. People use it to prove they own a domain.

The wait that confuses everyone

Every record carries a time to live, written TTL. It tells resolvers how long they may remember the answer. If you change a record, some people will still get the old answer until their copy expires. This is why a change can look done to you and not done to a friend. Lower the TTL before a planned move, and wait out the old value before you turn the old machine off.

An example from our own setup

For aiazic.com, we do not point the name straight at a public address on our server. Instead, a Cloudflare tunnel connects the name to a door on our own machine. Our setup file for that site says that the tunnel entries for aiazic.com and for www.aiazic.com both lead to port 8040 on the box, and that every path is passed through.

That leaves one question: which name should visitors see? Our web server answers it. In the same setup file there is a rule that catches www.aiazic.com and sends the visitor to aiazic.com, with a permanent redirect that keeps the rest of the address. The word permanent matters. It tells search engines that the short name is the real one.

So DNS gets a visitor to our door, and the web server decides what to do with them next. If you want to see that second half, the next article about one server holding many sites covers it.

Looking it up yourself

You do not need special tools. On most computers, a terminal accepts these commands.

nslookup amarbaro.com
dig amarbaro.com
dig amarbaro.com MX

The first two show the address for the name. The last shows where mail goes. If a lookup returns nothing, the entry does not exist yet or you made a typo.

What a record does not tell you

A record says where a name points. It does not say that the machine there is up, that the web server is configured for that name, or that the certificate is valid. Those are separate checks. A name can resolve fine while the page is broken. That is why we check from outside, with a real fetch, as covered in the article on how we know a site is up.

Words you may not know

  • Domain: a name you register, such as amarbaro.com.
  • Registrar: the shop where the domain is bought and renewed.
  • Nameserver: a machine that answers questions about your domain.
  • Resolver: the helper that asks nameservers on your behalf and remembers answers.
  • Record: one entry in the address book.
  • TTL: how long an answer may be remembered, in seconds.
  • Redirect: a reply that says "go to this other address instead".

Try it

  1. Run nslookup on a domain you know, for example amarbaro.com or doar.bio, and compare the two answers.
  2. Open amarbaro.com/web to see the sites we run. Each one is a name in some address book.
  3. Type www. in front of one of our domains and look at what the address bar shows after the page loads. That is a redirect at work.
  4. If you want a site of your own, buy a domain, then make one A record by hand and watch how long the change takes to show up.

If a lookup confuses you, ask on gllm.forum, our forum, where each post in this series gets a short note you can reply to.

Reacties

Nog geen reacties.

Inloggen om te reageren.