In the days of ARPANET (1970s) hosts.txt file was used for mapping of human-readable names to numerical addresses. As more computers were connected into the network, its modification became problematic.
There was a need for something better -- this task was assigned to Paul Mockapetris. He divised the DNS in early 1980s.
The first DNS name server implementation for Unix was created in 1984 and was named BIND (Berkeley Internet Name Domain). BIND program runs as a daemon called named.
DNS was formalized in multiple RFCs -- especially in RFC 1034 and RFC 1035.
A DNS zone is an administrative contiguous namespace. It is a portion of a DNS namespace managable by some entity (an organization or a person). A DNS zone has the authority over a part of DNS namespace it has been given.
Only in some cases a DNS zone equals a domain name.
A tool that accepts a query from a client and tries to get the full resolution done (e.g. translation of a domain name to an IP address).
It knows IP addresses of all the root nameservers.
Some public DNS resolvers:
The resolver either returns a record from its cache or it refers the client to a DNS server which is closest to the required zone (but it may refer only to a root DNS server).
The resolver tries to yield a final answer or returns an error message. It would attempt to get an answer recursively -- starting with root DNS servers, TLD name servers and further until it gets a final IP address or it fails.
A way to get a domain name from an IP address. Currently an obsolete type (RFC 3425) -- so called Reverse Mapping process is used now.
Some of these types are not mutually exclusive -- e.g. TLD nameservers can also be authoritative.
Authoritative nameserver is a server that actually maintains an original zone file for a requested domain (called master nameserver) or one of its slave nameservers (that mirrors master's zone file). These always hold the most up-to-date information about domains.
All the authoritative DNS servers must have a zone file -- a text file describing some DNS zone (which may or may not be a single domain).
If a dns resolver does not have the queried domain in the cache, it may need to eventually contact an authoritative DNS server.
Authoritative nameservers don't cache query results. A root zone file has around 2MB.
$ nslookup en.wikipedia.org Server: 192.168.0.1 Address: 192.168.0.1#53 Non-authoritative answer: en.wikipedia.org canonical name = dyna.wikimedia.org. Name: dyna.wikimedia.org Address: 91.198.174.192 Name: dyna.wikimedia.org Address: 2620:0:862:ed1a::1
Note that name server can be authoritative for some zones, but can also act as a caching name server for other zones. A name server that sends an authoritative message adds the AA bit into the answer.
These are records that are stored in zone files (of authoritative DNS nameservers).
All records must have a TTL (Time-To-Live) specified, which tells us how long can a DNS record be cached for.
$TTL 86400 @ IN SOA dns.example.com. root.example.com. ( 2014080601 ; Serial 1d ; refresh 2h ; retry 4w ; expire 1h ) ; min cache IN NS dns.example.com. IN MX 10 mail.example.com. gateway IN A 192.168.1.1 dns IN A 192.168.1.5 master IN CNAME dns.example.com. mail IN A 192.168.1.10 client IN A 192.168.1.15
This example was taken from the article RHEL7: Configure a master name server.