From Domain to IP: Demystifying DNS Records in Minutes | @swati_goyal_911 | QuizMaker
A concise guide to domain names, hostnames, canonical names, and IP addresses, and how DNS maps them using A, CNAME, NS, and MX records.
- Read
- 10m
- Type
- Blog
- By
- @swati_goyal
Series or course
System Design Essentials: Core Building Blocks
DNS is basically a huge phonebook:
π βHuman-readable nameβ β βIP addressβ
Example:
educative.io β 104.18.2.119
But instead of just one mapping, DNS stores different types of records (RRs) for different purposes.
π§© Key Terms (Super Important)1. π Domain Name
A domain name is the main name registered on the internet.
π Example:
educative.io
- Think of it as your brand / root identity
- Managed at domain level
2. π Hostname
A hostname is a specific machine/service under a domain.
π Examples:
www.educative.io
api.educative.io
relay1.main.educative.io
π Structure:
[hostname].[domain]
So:
-
educative.ioβ domain -
relay1.main.educative.ioβ hostname (specific server/service)
3. π― IP Address
The actual address of a machine on the internet
π Example:
104.18.2.119
- Computers talk using IPs, not names
4. π Canonical Name
βCanonicalβ = real/original name
A canonical name is the true hostname of a server.
π Used in CNAME records
Example:
educative.io β server1.primary.educative.io
Here:
-
educative.io= alias -
server1.primary.educative.io= canonical (real) name
π °οΈ A Record (Most Important)
π Maps hostname β IP address
(A, relay1.main.educative.io, 104.18.2.119)
Meaning:
-
Hostname:
relay1.main.educative.io -
IP:
104.18.2.119
π This is what ultimately lets your browser connect
π‘ NS Record (Name Server)
π Tells: βWho is responsible for this domain?β
(NS, educative.io, dns.educative.io)
Meaning:
-
Domain:
educative.io -
DNS server:
dns.educative.io
π This is used during DNS lookup process
π CNAME Record (Alias)
π Maps alias β real (canonical) hostname
(CNAME, educative.io, server1.primary.educative.io)
Meaning:
-
Alias:
educative.io -
Real server:
server1.primary.educative.io
π Then DNS will do:
server1.primary.educative.io β IP (via A record)
So CNAME = indirection layer
π§ MX Record (Mail Server)
π Tells where emails should go
(MX, mail.educative.io, mailserver1.backup.educative.io)
Meaning:
-
Email domain:
mail.educative.io -
Mail server:
mailserver1.backup.educative.io
π Used by email systems (SMTP)
βοΈ Differences (Crystal Clear)| Concept | Meaning | Example |
|---|---|---|
| Domain Name | Root identity | educative.io |
| Hostname | Specific machine/service | api.educative.io |
| Canonical Name | Real/original hostname | server1.primary.educative.io |
| IP Address | Machine address | 104.18.2.119 |
Letβs say you type:
https://educative.io
DNS might do:
- CNAME:
educative.io β server1.primary.educative.io
- A record:
server1.primary.educative.io β 104.18.2.119
- Browser connects to:
104.18.2.119π§ Intuition (Real-world analogy)
Think of it like this:
- Domain name = Company name
- Hostname = Specific office
- Canonical name = Official registered office
- IP address = GPS coordinates
CNAME is like:
π βThis office is actually handled by another main officeβ
- Domain = top-level identity
- Hostname = specific service under domain
- Canonical name = actual server name (used in CNAME)
- IP address = real machine location
- A record = final step (name β IP)
- CNAME = alias layer (name β name β IP)Β