Domains and DNS

What is DNS and how does it work?

DNS (the Domain Name System) is the internet's directory. It translates a name like yourbusiness.in into the IP address of the server that hosts the website or receives the email, using a chain of servers and a set of records you control.

Updated 6 min read

DNS in plain words

Computers on the internet find each other by IP address, such as 203.0.113.10. People prefer names, such as yourbusiness.in. DNS, the Domain Name System, is the distributed directory that links the two. It was defined in RFC 1034 and RFC 1035 in 1987 and still works on the same basic model.

A useful comparison is your phone's contacts. You tap "Sharma Electricals" and the phone dials the number stored against it. DNS does the same for every website visit and every email sent, except the contact list is spread across millions of servers worldwide.

DNS answers more than "which server hosts the website". It also says which servers accept your email, which services you have verified, and which certificate authorities may issue SSL certificates for you.

How a DNS lookup works, step by step

Say a customer in Pune types www.yourbusiness.in into Chrome. Before the page can load, this happens, usually in well under a second:

  1. Local cache. The browser and operating system check whether they looked this name up recently. If the answer is still fresh, they use it and stop here.
  2. Recursive resolver. If not, the device asks a recursive resolver. This is usually run by the internet provider (Jio, Airtel, ACT and so on) or a public resolver the user has chosen. The resolver does the legwork.
  3. Root servers. The resolver asks a root server, "Who handles .in?" The root replies with the nameservers for the .in top level domain.
  4. TLD servers. The resolver asks the .in servers, "Who handles yourbusiness.in?" They reply with the domain's authoritative nameservers, the ones set at your registrar.
  5. Authoritative nameserver. The resolver asks those nameservers for www.yourbusiness.in. They return the actual record, for example a CNAME to yourbusiness.in and an A record with the server's IP address.
  6. Answer and cache. The resolver returns the IP address to the browser and caches it for the record's TTL. The browser then connects to that IP and requests the page.

Steps 3 to 5 happen only when nothing is cached. Popular names are almost always cached at large resolvers, which is why DNS is usually fast.

Nameservers: who holds your records

The authoritative nameservers for your domain hold the master copy of its DNS records. Which nameservers those are is set at your registrar.

  • If your domain uses your registrar's nameservers, you edit DNS records at the registrar.
  • If it uses your web host's nameservers, you edit records in the hosting control panel (the Zone Editor in cPanel, or DNS settings in Plesk).
  • If it uses a DNS service such as a CDN, you edit records there.

Editing records in the wrong place is the most common DNS mistake. Always check which nameservers are active first. The help article on pointing your domain's nameservers shows how to change them, and how to connect a domain to hosting explains when to change nameservers and when to change only records.

DNS record types you will meet

Record What it does Example value
A Points a name to an IPv4 address 203.0.113.10
AAAA Points a name to an IPv6 address 2001:db8::10
CNAME Makes one name an alias of another name www → yourbusiness.in.
MX Lists the mail servers that accept email for the domain, with priorities 10 mail.yourbusiness.in.
TXT Holds free text; used for SPF, DKIM, DMARC and ownership verification v=spf1 ... ~all
NS Lists the authoritative nameservers for the domain or a delegated subdomain ns1.examplehost.net.
SOA Start of Authority: the zone's primary server, admin contact, serial number and timers One per zone, created automatically
CAA Lists which certificate authorities may issue SSL certificates for the domain 0 issue "ca.example.net"

Here is how a small business zone might look in standard zone file format. The addresses are documentation examples:

$ORIGIN yourbusiness.in.
$TTL 3600
@     IN  SOA   ns1.examplehost.net. hostmaster.yourbusiness.in. (
                2026101301 3600 900 1209600 3600 )
@     IN  NS    ns1.examplehost.net.
@     IN  NS    ns2.examplehost.net.
@     IN  A     203.0.113.10
@     IN  AAAA  2001:db8::10
www   IN  CNAME yourbusiness.in.
@     IN  MX    10 mail.yourbusiness.in.
mail  IN  A     203.0.113.10
@     IN  TXT   "v=spf1 a mx ~all"
@     IN  CAA   0 issue "ca.example.net"

A few rules worth knowing:

  • A CNAME cannot sit alongside other records with the same name. That is why the bare domain (@) normally uses an A record and www uses a CNAME. The help article on A records vs CNAME explains the choice.
  • MX records must point to a hostname, not an IP address or a CNAME.
  • A domain should have only one SPF record. Two SPF TXT records make SPF fail. The guide to SPF, DKIM and DMARC shows how to merge them.
  • CAA is optional. If you add one, include every CA you use, or certificate renewals will fail.

TTL: why changes are not instant

Every record has a TTL (time to live) in seconds. It tells resolvers how long they may cache the answer.

TTL Means Use it when
300 5 minutes You are about to change a record
3600 1 hour Normal day to day setting
86400 1 day Records that almost never change

If your A record has a TTL of 86400 and you change the IP, some resolvers keep serving the old IP for up to a day. People call this "DNS propagation", though really it is old caches expiring. Lower the TTL a day before a planned change and raise it again afterwards. The help article on DNS propagation covers how to check progress.

Checking DNS yourself

You can see what the world sees with built in tools. nslookup works on Windows, macOS and Linux:

nslookup yourbusiness.in
nslookup -type=MX yourbusiness.in
nslookup -type=NS yourbusiness.in 8.8.8.8

On macOS or Linux, dig gives more detail:

dig yourbusiness.in A +short
dig yourbusiness.in TXT
dig +trace www.yourbusiness.in

dig +trace walks the same chain described above, from the root to your authoritative nameservers, which is useful when you are not sure which nameservers are live.

Common DNS mistakes

Mistake What happens Fix
Editing records at the registrar while the domain uses the host's nameservers Changes have no effect Check NS records, then edit at the active provider
Changing nameservers without copying MX and TXT records Email stops; verifications break Copy all records to the new zone first
Two SPF records SPF fails; mail goes to spam Merge into one v=spf1 record
Old AAAA record left after moving hosts IPv6 users reach the old server Delete or update the AAAA record
Typo in a nameserver DNS_PROBE_FINISHED_NXDOMAIN for visitors Copy and paste exact values
Domain expired Site and email stop together Renew at the registrar; enable auto renew

If a site will not load at all, the guide to troubleshooting common hosting errors includes DNS errors alongside server ones.

DNS and your hosting

ODHOST note: ODHOST does not currently register domains, so you connect a domain you already own. You can either point it to ODHOST's nameservers or keep your current DNS provider and add an A record. The nameservers and server IP for your account are in your welcome email and client area.

Once DNS points at your hosting, the domain and the server work as a pair. The guide on domain vs hosting explains how the two relate and what each costs.

Frequently asked questions

What is a DNS server?

A DNS server answers questions about domain names. Recursive resolvers, usually run by your internet provider or a public service, look up answers for you. Authoritative nameservers hold the actual records for a domain.

What is the difference between DNS and a domain?

A domain is the name you register, such as yourbusiness.in. DNS is the system that stores the records for that name and tells the world which servers handle its website and email.

Why do DNS changes take time to show up?

Resolvers cache answers for the TTL set on each record. Until that time runs out, some people still get the old answer. Lowering the TTL before a change shortens the wait.

Can I use one provider for my domain and another for DNS?

Yes. The registrar records which nameservers are authoritative for your domain. Those nameservers can belong to your registrar, your web host or a separate DNS service.

Sources and further reading

Contact us