Advent calendar From 1 December, a new deal every day at 8 am. To the calendar
Network & connectivity

What is a domain and how does name resolution (DNS) work?

In short

A domain is a readable name such as example.com that stands for one or more IP addresses on the internet. The Domain Name System (DNS) translates this name into the address of the server, so browsers and mail servers know where to connect. A resolver fetches the answer step by step from root servers, TLD servers and the domain's authoritative name server and caches it for a set period of time.

Key facts

Purpose
Translate names into IP addresses
Protocol
Port 53 over UDP and TCP
Root servers
13 identities, mirrored worldwide via anycast
Most common records
A, AAAA, CNAME, MX, TXT, NS
TTL
Cache lifetime of an answer in seconds
DNSSEC
Signs answers but does not encrypt them

How is a domain structured?

A domain is read from right to left, and each part separated by a dot is called a label. On the far right is the top-level domain (TLD), such as .de, .com or .eu. To its left comes the second-level domain, the actual name you register, for example example in example.com. Everything further left is a subdomain, such as www or shop in shop.example.com. As the holder you create subdomains yourself, without any further registration. Technically every name ends with an invisible dot that stands for the root zone. A single label can be up to 63 characters long, the full name up to 253 characters.

What happens during a DNS lookup?

When you open www.example.com in your browser, your computer does not query the whole DNS itself. It passes the question to a recursive resolver, usually run by your internet provider or a public DNS service. If the resolver does not have the answer in its cache, it works through the hierarchy from the top down:

  • The operating system checks its own cache and the hosts file and then asks the configured resolver.
  • The resolver asks a root server which name servers are responsible for the TLD .com.
  • The registry's TLD server names the name servers registered for example.com.
  • The domain's authoritative name server returns the requested record, for example the IPv4 address of www.example.com.
  • The resolver passes the answer back to your computer and caches it for the duration of the TTL.

Because resolvers cache answers, the full chain rarely runs. Most queries are answered from a cache within a few milliseconds.

Which record types do you need?

A domain's records are stored in its zone on the authoritative name server. Each record has a name, a type, a value and a TTL. For a website and email you get by with a few types:

  • A: points a name to an IPv4 address, for example 203.0.113.10.
  • AAAA: the same for an IPv6 address.
  • CNAME: makes a name an alias of another name, for example www for example.com.
  • MX: names the mail server that accepts email for the domain, with a priority. The lower value is tried first.
  • TXT: free text, today mainly used for SPF, DKIM, DMARC and verification with services such as search engines.
  • NS: defines which name servers are responsible for the domain or a subdomain.

A CNAME must not exist alongside other records with the same name. It is therefore not allowed on the domain itself (example.com without a subdomain), because NS and SOA records always sit there.

Who is responsible for which part?

Three parties are often confused. The registry operates a TLD and its name servers: DENIC for .de, Verisign for .com, EURid for .eu. The registrar is the provider you order the domain from and who registers it with the registry on your behalf. The name servers holding the zone with your records are usually run by the registrar or your hosting provider, but you can also enter your own or those of another service. The registry stores which name servers apply to your domain. If you change this delegation, the records on the new name servers apply from then on. How to transfer a domain to another registrar is described in the guide to moving a domain.

TTL and propagation

The TTL (time to live) states in seconds how long a resolver may cache an answer. Common values are 3600 seconds, one hour, or more. When you change a record, visitors only see the new value once the old answer in their resolver has expired. This transition period is often called propagation, although nothing is actively distributed: the caches simply expire one after another. Changes to the delegation itself also depend on the TTL of the NS records at the registry, which is often around one day. If you are planning a server move, lower the TTL of the affected record to about 300 seconds a day in advance. After the switch almost all visitors then reach the new server within a few minutes, and you can raise the TTL again afterwards.

What does DNSSEC do?

Classic DNS does not check whether an answer is genuine. An attacker who injects forged answers into a resolver could redirect visitors to a different server. DNSSEC signs the records of a zone with a key. A hash of this key is stored as a DS record at the registry, and the TLD is in turn signed by the root zone. This creates a chain of trust that a validating resolver can check all the way to the root. If a signature does not match, it discards the answer. DNSSEC does not encrypt anything; anyone reading the traffic still sees the names being queried. Separate methods such as DNS over TLS and DNS over HTTPS exist for that. When you change name servers or registrar, the DS records must match the new keys, otherwise the domain can no longer be resolved by validating resolvers.

At Realtoxmedia you edit the A, AAAA, MX, CNAME and TXT records of your domains yourself in the customer panel. Changes usually take effect within a few minutes.

Bottom line

A domain is a name, and DNS turns it into the address of a server. To do so, the resolver queries root servers, TLD servers and the authoritative name server in turn and caches the result for the duration of the TTL. If you are planning a move, lower the TTL well in advance and the switch takes effect within minutes.

Questions about our services?

Write to us. Advice on the right configuration is free and without obligation.