Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Understanding the DNS Process

See how a domain name turns into an IP address, and what the main DNS record types do.

Domains and DNS3 min read7 steps9 screenshots

What is DNS

The Domain Name System (DNS) is the phone book of the internet. People use names such as example.com. Computers use IP addresses such as 203.0.113.10. DNS translates one to the other.

How the DNS process works

When you type a domain in your browser:

  1. The browser checks its own cache, then your operating system cache.
  2. If it does not know the answer, it asks a recursive resolver (usually run by your internet provider or a public service).
  3. The resolver asks a root server, which tells it which servers handle the top-level domain (.com).
  4. The resolver asks the TLD server, which tells it the authoritative name server of the domain.
  5. The resolver asks the authoritative server, which gives the IP address.
  6. The resolver returns the answer to your browser and keeps it in its cache for a while (the TTL).
  7. The browser connects to the IP address.
    The DNS lookup process

DNS servers

Authoritative DNS server

It holds the real records of a domain and gives the final answer.

Recursive name server

It does the searching for the user. It asks other servers and caches the answers.

DNS zones

A zone is a part of the DNS name space managed by one party, for example example.com and its records.

DNS zone file

A zone file is a text file (or database) with all the records of a zone.

A DNS zone file

DNS record types

A (Address) record

Points a name to an IPv4 address. (AAAA records do the same for IPv6.)

example.com.   3600  IN  A  203.0.113.10
An A record

CNAME (Canonical Name) record

Makes a name an alias of another name.

www.example.com.   3600  IN  CNAME  example.com.
A CNAME record

MX (Mail Exchanger) record

Says which servers receive email for the domain, with a priority. The lower number is tried first.

example.com.   3600  IN  MX  10  mail.example.com.
An MX record

TXT (Text) record

Holds text. It is used for SPF, DKIM, DMARC and for proof of domain ownership.

example.com.   3600  IN  TXT  "v=spf1 include:_spf.example.com ~all"
A TXT record

NS (Name Server) record

Lists the name servers that are authoritative for the domain.

example.com.   86400  IN  NS  ns1.example.com.
An NS record

SOA (Start of Authority) record

The first record of a zone. It holds:

  • The name of the primary DNS server.
  • The email address of the person responsible for the zone.
  • The serial number, used by secondary servers to see if the zone changed.
  • The refresh interval.
  • The retry interval.
  • The expire interval.
  • The minimum (default) TTL.
    An SOA record

SRV (Service) record

Tells where a service runs. It has a host name, port, priority, weight and target.

_sip._tcp.example.com.  3600  IN  SRV  10 60 5060 sip.example.com.

Here _sip is the service and _tcp is the protocol.

An SRV record

Check DNS yourself

dig example.com A
dig example.com MX
nslookup example.com

Quick recap

  • A browser asks a resolver, which asks the root, the TLD and the authoritative server.
  • A, CNAME, MX, TXT, NS, SOA and SRV records each have a job.