Back to Blogs
Web Basics

DNS Basics Explained in Simple Words

P
Punyansh Singla
January 30, 20268 min read
DNSWeb DevelopmentInternet BasicsBeginner GuideDomain & Hosting

Type google.com into your browser and press Enter.

You don’t see it, but a small chain of questions starts running in the background.

Your browser does not know:

  • where Google’s code is stored
  • which computer (server) to talk to
  • what the actual address is

So the browser asks a simple question:

“Where is this website?”

The system that answers this question is called DNS.

What is DNS?

DNS stands for Domain Name System.

In very simple terms, DNS is the phonebook of the internet.

  • Humans remember names like google.com
  • Computers work with numbers like 142.250.192.14 ( ip address )

DNS connects the name to the number.

It works just like a phonebook:

  • you see a phonebook for a name
  • you get a number
  • you use that number to make the call

Your browser does the same thing, just much faster.

Why DNS records are needed

DNS is not just about finding a website.

A domain usually needs many things:

  • a place where the website is hosted
  • a place where emails should be delivered
  • proof that the domain belongs to you
  • instructions for third-party services

Because of this, DNS uses records.

Each record has one clear job.

You can think of DNS like a folder:

  • one page for the website address
  • one page for email routing
  • one page for verification

Each page answers a different question.

NS Record – Who is in charge of the domain

NS stands for Name Server

This record answers a basic question:

“Who manages this domain’s DNS?”

Imagine a city.

If someone asks:

> “Who has the official details for this house?”

The answer might be:

> “Talk to this office.”

NS records tell the internet:

> “For this domain, ask these DNS servers.”

If NS records are wrong:

  • the website will not open
  • emails will not work
  • the domain becomes unreachable

Important thing to remember:

NS records do not point to your website.

They only decide who controls the DNS settings.

A Record – Connecting the domain to the server

A record means Address record

This is the most important record for a website.

It answers this question:

“Which server should load this website?”

Example:

example.com → 93.184.216.34

Think of it like:

  • a house name → a house number

Once the browser gets this number, it knows exactly where to go.

If a website is not loading, this is usually the first record people check.

AAAA Record – Same purpose, newer format

The AAAA record does the same job as an A record.

The only difference:

  • A record uses IPv4 addresses
  • AAAA record uses IPv6 addresses

As a beginner, you don’t need to stress about this.

If your hosting provider gives you an IPv6 address, you add it here.

CNAME Record – One name pointing to another

CNAME stands for Canonical Name

This record says:

> “This domain name is just another name for a different domain.”

Example:

www.example.com → example.com

So when someone opens https://www.punyansingla.com:

  • DNS says: “Check punyanshsingla.com instead.”

Common confusion: A record vs CNAME

  • A record points directly to an IP address
  • CNAME record points to another domain name

A CNAME never points straight to an IP address.

MX Record – Where emails should go

MX stands for Mail Exchange

This record answers:

“Which server should receive emails for this domain?”

When someone sends an email to:

punyanshcoder@gmail.com

Mail servers first look at the MX records to decide:

  • where to deliver the email
  • which mail server has higher priority

If MX records are missing or incorrect:

  • emails will fail
  • the website can still work normally

Common confusion: NS vs MX

  • NS decides who controls DNS
  • MX decides how emails are delivered

They solve completely different problems.

TXT Record – Extra information and trust

TXT means Text record

TXT records store extra information about a domain.

They are commonly used for:

  • domain ownership verification
  • email security (SPF, DKIM)
  • connecting services like Google or GitHub

Example:

google-site-verification=abc123

Humans usually ignore TXT records.

Machines read them to decide whether your domain is trustworthy.

How all DNS records work together

My domain is:

👉 https://www.punyanshsingla.com/

When someone types your domain in a browser or sends you an email, a lot of things happen quietly in the background.

That system is called DNS.

You never see it working, but without DNS, your website would not open and emails would never reach you.

A normal DNS setup looks like this

  • NS (Name Server)

This decides which DNS provider is responsible for your domain.

Whenever someone asks, “Where is this domain?”, the NS record tells them who has the answer.

  • A Record

This connects your domain to a server IP address.

In simple words, it tells the browser where your website is actually hosted.

  • CNAME Record

This points one domain or subdomain to another domain name.

Example:

www.punyanshsingla.commywebsite.com

One important thing to remember:

A domain usually uses either an A record or a CNAME, not both at the same time.

  • MX Record

This handles email delivery.

It tells the internet which mail server should receive emails sent to your domain.

Without MX records, emails will simply fail.

  • TXT Record

This is mostly used for verification and securitya.

Common uses include:

- Verifying domain ownership

- Preventing email spam (SPF, DKIM, DMARC)

- Connecting third-party services

When everything is set correctly

  • the website opens normally
  • emails arrive in the inbox
  • external services work without problems

DNS does all of this silently.

You rarely notice it when it works, but the moment something is wrong, everything stops working.

Enjoyed this article?

Share it with your network

Punyansh's AssistantOnline
AI

Hey there! 👋 I'm Punyansh's AI assistant. Feel free to ask me anything about his skills, projects, or experience!

20 LEFT