DEV Community

Swadesh Chatterjee
Swadesh Chatterjee

Posted on

DNS Record Types Explained

How does a browser know where a website lives?

When you type a URL into a browser, it does not inherently know where that website is located physically. It uses DNS as the phonebook of the internet.

Im

What is DNS and why do we need it?

  • The Domain Name System (DNS) is the decentralized system that translates human readable hostnames into machine readable IP addresses.
  • Humans are good at remembering names (like amazon.com) but bad at remembering strings of random numbers (IP addresses). DNS bridges this gap.

What are DNS records and what problems do they solve?

DNS records are the specific entries in the phonebook. They solve the problem of routing different types of traffic to different places.

In

Dns Records

• NS Record(Name Record):
Indicates who controls the domain. It points to the authoritative DNS server that stores all the other records for that domain.
_ A / AAAA Record:_

  • Maps a domain to an IPv4 address (e.g., 192.0.2.1).
  • Maps a domain to an IPv6 address (e.g., 2001:0db8::1).
  • These are the primary records that get your browser to the website server.

Im

CNAME Record (Canonical Name):

  • Maps one name to another name (an alias).
  • It often points www.example.com to example.com. It says, "I don't have the IP; ask that domain over there."

MX Record (Mail Exchange):

  • Specifies the mail servers responsible for accepting email on behalf of the domain. Without this, you cannot receive email at @yourdomain.com.

TXT Record (Text):

  • Stores text-based information. It is heavily used for verification (proving ownership to Google/Microsoft) and email security (SPF/DKIM) to prevent spam.

Top comments (0)