Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Published
2 min read
DNS Record Types Explained
L

Learning in public

Overview

Suppose I want to call my friend Rahul, But my phone don’t understand ‘Rahul’. It need Rahul’s phone number. So the phone checks the number which is mapped with name ‘Rahul’ in phonebook and then dials it. Same way Browser don’t understand domain name like ‘google.com’ it only understand number like ‘172.217.19.164’. So the Browser needs google.com’s number. Here DNS comes into play. It is the phonebook of the internet.

Why DNS records are needed ?

More than providing IP address, DNS plays different roles like :

  • Recieve Mail

  • Redirect Subdomains

  • Verify Ownership

Each of these need different instructions. Those instruction are called DNS records

What an ‘A’ record is

  • It directly Points to an IPv4 Address

  • google.com’ → ‘172.217.19.164’

  • Without ‘A’ record a website cannot be found

What an ‘AAA’ record is

  • Same as ‘A’ records but it is for IPv6 address

  • New Address format

  • Allow website to work on modern IP System

What a CNAME Record is

  • A domain name is just another name for another domain

  • Like : www.example.com → example.com both refer to same website

  • Easier management and Cleaner Setup

What an MX Record is

  • MX stands for Mail Exchange

  • It Points to the mail server of a website

  • Like : example.com → mailprovider.com

What a TXT Record is

  • Stores text information

  • Used for domain verfication, ownership proof, etc

  • Ex: google-site-verification=abc123

How all DNS records work together for one website

  • User type : ‘www.google.com’

  • Browser asks DNS system

  • DNS checks NS to find authority

  • Find CNAME (www→ google.com)

  • Looks for a record

  • Gets IP Address

  • Browser connects to server

  • Website loads