DNS (Domain Name System) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet. Essentially, it translates easily-memorized domain names that are typed in a web browser's address bar into an IP address that points to a server that is hosting content.
Types of Name Servers
Root Name Servers
A root name server is the starting point of a DNS query and is responsible for the fundamental function of translating a domain name into an IP address. When a resolving name server does not know the IP address to which a domain resolves, it queries one of the thirteen root name server addresses. Check out the chart below for more information on root name servers:
Depending on the domain being queried, the root name server will direct the resolving name server to the appropriate TLD name server.
TLD (Top-Level Domain) Name Servers
A TLD (top-level domain) is the highest level of a domain name. It is the last part of the domain name, that is, the label that follows the last dot (.) in an FQDN (Fully Qualified Domain Name). For example, in the domain name
example.com, the top-level domain is
com. The TLD name server is responsible for directing a resolving name server to the assigned authoritative name servers.
Authoritative Name Servers
An authoritative name server houses the DNS zone file for a domain and is responsible for answering queries about records in the zone file. A person or organization that registered a domain is able to set their authoritative name servers with their registrar.
DNS Zone File
The DNS zone file stores various records which specify the destinations hosting services associated with a domain (e.g. web addresses are translated with an A-record and email uses an MX-record). Below is an example of a zone file:
Common Types of DNS Records
- A-record; the most common record. It maps a fully qualified domain name (FQDN) to an IP address.
- MX-record; used to identify where email resolves. Although an MX record can point to an IP address it should point to an FQDN (e.g. mail.example.com).
- CNAME-record; (canonical name) maps an alias to an FQDN. When a resolving name server comes across a CNAME record, it forwards the request to a third-party, who in turn interprets the request and acts accordingly.
- TXT-record; allows domain administrators to insert any string into a DNS record. TXT records are not used to direct any traffic, but to provide information to outside sources.
- NS-record; identifies which DNS server is authoritative for a particular zone.
- SOA-record; stores information about the name server. The server that supplies the data for the zone, the administrator of the zone and the current version of the data.
TTL (Time-to-Live) is the time period for which resolving name servers cache information from an authoritative name server. A typical TTL is 86,400 seconds (i.e. 24-hours). Once the TTL expires, the resolving name server discards the information.
DNS is important because it helps humans use easily recognizable names instead of numbers when navigating to websites on the Internet.