The Domain Name System (DNS) is a hierarchical and decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates more readily memorized domain names to the numerical IP addresses needed for the purpose of locating and identifying computer services and devices with the underlying network protocols.
DNS is built on a client-server model. DNS clients, such as web browsers, send DNS queries to DNS servers to resolve domain names to IP addresses. A DNS server is a computer that stores a database of domain names and their corresponding IP addresses. When a DNS client sends a query to a DNS server, the server looks up the IP address for the requested domain name in its database and sends it back to the client.
DNS is organized into a hierarchy, with the “root” at the top. The root is not an actual server, but a placeholder for the top level of the hierarchy. At the top level of the hierarchy are the “top-level domains” (TLDs), such as .com, .org, and .edu. Underneath the TLDs are the “second-level domains”, such as example.com. Each level of the hierarchy has its own set of DNS servers that are responsible for managing the domain names at that level.
When a DNS client sends a query for a domain name, the query starts at the root and works its way down the hierarchy until it reaches the DNS servers that are responsible for the domain name in question. This process is called “resolution”.
DNS uses different types of records to store information about domain names. The most common types of records are:
- A (Address) records: Map a domain name to an IP address.
- MX (Mail exchange) records: Map a domain name to one or more mail servers.
- CNAME (Canonical name) records: Map a domain name to another domain name.
- NS (Name server) records: Specify the name servers for a domain name.
Each DNS server has a copy of the zone file, which contains all the DNS records for a domain. When a change is made to the DNS records for a domain, it is made on the primary DNS server for that domain, and then propagated to the secondary DNS servers.
In summary, DNS is a system that translates domain names into IP addresses, allowing users to access websites and other resources on the Internet using easily remembered names. It is built on a hierarchical and decentralized model, with DNS clients sending queries to DNS servers, which look up the IP address for the requested domain name in their databases and send it back to the client.