Ravindra BagaleCourses & study guides मराठी Track your progress

Chapter 9: Domain Names, DNS and Subdomains

9.3 DNS record types you must know

Friends, a DNS record is a small rule – this name, this type, this value. A, CNAME and TXT are used every day; for the rest, being able to recognise them is enough.

Record Purpose Example (name → value)
A Name → IPv4 address @ → 13.233.10.25
AAAA Name → IPv6 address @ → 2406:da1a:...
CNAME Name → another name (alias) www → example.com
MX Mail servers for the domain (with priority) @ → 10 mail.​example.​com
TXT Free text, used for verification, SPF, DKIM @ → "v=​spf1 include:_​spf.​google.​com ~all"
NS Which name servers are authoritative @ → ns51.​domaincontrol.​com
SOA Start of authority: zone admin info and serials created automatically
CAA Which certificate authorities may issue certificates @ → 0 issue "letsencrypt.​org"
Alias (Route 53) Like a CNAME but allowed at the apex, for AWS resources @ → load balancer / CloudFront

CNAME rules

A CNAME cannot be used at the apex (@), and a name with a CNAME can't have any other record. For the root domain always use an A record (or a Route 53 Alias). Use CNAME for names like www.

TTL and "propagation"

TTL (Time To Live) is how many seconds resolvers may cache a record. With TTL 3600, a resolver that looked up your old IP may keep using it for up to one hour after you change it. That delay is what people call DNS propagation. Nothing is actually pushed around the world; old cached answers simply expire.

  • Before a planned change (e.g. moving to a new server), lower the TTL to 300 (5 minutes) a day earlier.
  • After the change is stable, raise it again (e.g. 3600) to reduce lookups.
  • A new domain's name server change at the registrar can take longer, sometimes a few hours, because TLD servers and resolvers cache NS records with long TTLs.

Ravindra Bagale's Tip

The day before you move a server, set the TTL to 300 – I do this in every migration. Then the change shows up quickly, and once things are stable, set the TTL back to 3600. And remember: never a CNAME at the apex @ – use an A record or a Route 53 Alias there.

Lab

Chala, dig example.com don vela, kahi second antarane chalva aani ANSWER SECTION madhla TTL kami hot jato ka te bagha. Mag dig MX example.com +short aani dig NS example.com +short chalvun konte records distat te liha.