October 27, 2025
Domain Name System (DNS)
Resource Records
1. Address
This category of records contains the information about the IP address of a domain name. The IP address is used to locate the server that hosts the website or service. It is divide into 2
- A (IPv4 Address); this is used to store the IPv4 address of a domain name.
- AAAA (IPv6 Address); this is used to store the IPv6 address of a domain name.
dig google.com -t A. # get the ipv4 address of google.com
dig google.com -t AAAA. # get the ipv6 address of google.com
2. CNAME (Canonical Name)
This is used create alias for a domain name. For example if you have domain with example.com, and you also have docs.example.com, drive.example.com, these records still point to the same IP Address (example.com) but with different hostnames.
| Host | Type | Value |
|---|---|---|
| example.com | A | 142.234.53.1 |
| docs.example.com | CNAME | example.com |
| drive.example.com | CNAME | example.com |
| mail.example.com | CNAME | example.com |
3. MX (Mail Exchange)
This record is how servers know which mail server to use for a domain name. It is used to specify the mail server that is responsible for accepting email messages for a domain name. For example I (obadafidi@example.com) sends a mail to my friend (tolulope@yahoo.com) the DNS resolution flow will be like this
- The DNS resolver will first look up the MX record for the domain name
example.com. - The MX record will specify the mail server that is responsible for accepting email messages for the domain name
example.com. - The DNS resolver will then look up the IP address of the mail server using the A record (IPv4)
- The mail server will then accept the email message and deliver it to the recipient email server (
yahoo.com) - Then the mail server on
yahoo.comwill authenticate the email message to ensure it is from a trusted source. - The mail server on
yahoo.comwill then deliver the email message to the recipient's email once verification is complete.
Results
1. Lookup real domains
The server responds with the domain name and IP for address for amazon.com
Same thing happens for google.com
2. Lookup fake domains
Conclusion
DNS resolution is a layered process where record types serve distinct responsibilities, from translating names to IP addresses (A, AAAA) to routing mail (MX) and creating aliases (CNAME). Building this project made those responsibilities concrete and highlighted how small protocol details shape reliability and user experience.
Future Improvements
- Write DSN parser
- Implement TLS/SSL support
- Add support for other DNS record types (TXT, CNAME, etc.)