The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. A Domain Name Service resolves queries for these names into IP addresses for the purpose of locating computer services and devices worldwide. By providing a worldwide, distributed keyword-based redirection service, the Domain Name System is an essential component of the functionality of the Internet.
The DNS system's main aim is to match a domain name to an IP Address. In order to fulfill this role, the DNS Server contains Resource Records (Records) in a Zone File, which contains the domain name and IP address mappings for computers contained within that Zone. All Resource Records have a Time To Live TTL (TTL), specifying the number of seconds other DNS servers and applications are allowed to cache the Record.
Resource records
- A - Returns a 32-bit IPv4 address, most commonly used to map hostnames to an IP address of the host, but also used for DNSBLs, storing subnet masks in RFC 1101, etc.
- AAAA - Returns a 128-bit IPv6 address, most commonly used to map hostnames to an IP address of the host.
- CNAME - Alias of one name to another: the DNS lookup will continue by retrying the lookup with the new name.
- MX - Maps a domain name to a list of message transfer agents for that domain.
- PTR - Pointer to a canonical name. Unlike a CNAME, DNS processing does NOT proceed, just the name is returned. The most common use is for implementing reverse DNS lookups, but other uses include such things as DNS-SD.
- NS - Delegates a DNS zone to use the given authoritative name servers.
- SOA - Specifies authoritative information about a DNS zone, including the primary name server, the email of the domain administrator, the domain serial number, and several timers relating to refreshing the zone.
- SRV - Generalized service location record, used for newer protocols instead of creating protocol-specific records such as MX.
- TXT - Originally for arbitrary human-readable text in a DNS record. Since the early 1990s, however, this record more often carries machine-readable data, such as specified by RFC 1464, opportunistic encryption, Sender Policy Framework, DKIM, DMARC DNS-SD, etc.
Other types of records simply provide some types of information (for example, an HINFO record gives a description of the type of computer/OS a host uses), or others return data used in experimental features. The "type" field is also used in the protocol for various operations.