Domain Name System basics
Imagine what life would be like, if each time we wanted to browse a website we had to type in its IP address. Would we have to memorise all IP addresses, would we have note down all out favourites websites on a notepad or excel sheet ?
Fortunately, we dont and thanks to DNS we only have to remember the website name.
DNS is a service which maps websites domain names to IP addresses, and responds to queries with this exact mapping.
But how does it all work at a network understanding level ?
DNS query
PC wants to browse networkslearning.com site, so it sends a request to a DNS server asking what is the IP address ob this website ?
DNS query is sourced from 194.10.10.12 to a destination of the DNS server IP 8.8.4.4 and a known DNS port 53.
DNS reply
DNS servers replies to the PC with the information that networkslearning.com is at IP 201.10.10.23. This reply is sourced from DNS IP and port 53, with a destination of PC IP address.
Browsing
Now that the PC knows networkslearning.com IP address, it simply opens a session on known port 80 and destination IP address on the actual server hosting this website.
Domain Name Structure
Information as important and critical as DNS must be organised in a very careful, efficient and smart manner. There is a hierarchy used for DNS, also called domain name space, starting with a Root level, then different branches corresponding to several domains such as .com for commercial, .edu for educational organisations.
DNS Records
There are different types of DNS records, below table shows lists some of the important ones.
Record Type | Description |
---|---|
A Record | A, for Address record points a domain name to an IP address. |
CNAME | Canonical name redirects one domain to another, for example baby.com directs you to www.baby.com |
AAAA | This is the A records for IPv6 addresses. |
TXT Record | This records does not redirect, but provides information depending on your needs. |
MX Entry | Directs to emails to a mail exchange server. |
PTR | This is a reverse DNS, so will answer which IP is this domain on ? |