iwantcoding.com
🔥 Daily 👥 Rooms 🏆 Top Log in Sign up

3.3 DNS & Subdomains

The Domain Name System (DNS) maps human-readable names to IP addresses. It is hierarchical, distributed, cached, and the source of more outages than its quiet reputation suggests.

3.3 DNS and Subdomains

DNS resolution flow

Client Recursive resolver Root . TLD (.ph) Authoritative Answer (A/AAAA) Figure 3.3 - Recursive resolver walks Root, TLD, Authoritative; caches each answer.

Record types

TypePurpose
AIPv4 address for a name
AAAAIPv6 address for a name
CNAMEAlias to another name
MXMail exchanger for the domain
NSAuthoritative nameserver for the zone
TXTFree-form; SPF, DKIM, ownership proof
SRVService location (port + host)
CAAWhich CAs may issue certificates for this name

TTL strategy

RangeTrade-off
Short (60-300 sec)Fast failover; more queries; more cost
Default (3600 sec)Hourly refresh; balanced
Long (86400+ sec)Cheap, slow to change

Plan TTL drops a day before a planned change.

DNS security pitfalls

PitfallRisk
No DNSSECForged answers in transit
Old MX recordsMail to dead servers; silent loss
Wildcards (*.example.ph)Matches subdomains you forgot
CNAMEs to expired domainsSubdomain takeover
Mentor’s tip: DNS is a distributed cache, not a database. Plan TTL drops before changes. Audit MX, TXT, and wildcards yearly. DNSSEC + CAA + monitoring are the difference between quiet DNS and headline DNS.

Discussion

Loading…