What Is a DNS Record
DNS records are the smallest units of the DNS. A Domain Name System record is a series of instructions that connect domain names with IP addresses within DNS servers. They contain all possible information about a domain, such as its tasks, and define where everything is located.
These records form the technical foundation of how domains operate. Each record answers a specific question, such as where a website is hosted, or which server receives an email. Together, they enable reliable communication across networks.
Purpose of DNS Records
DNS records control how services associated with a domain behave. They guide resolvers to the correct destination and define how external systems interact with the domain. Without DNS records, domain names would have no functional meaning.
Each record type serves a defined role. Some records route web traffic, while others support email delivery or service discovery. Security-related records help validate identity and prevent abuse. Administrators manage these records within DNS zone files on authoritative name servers.
Consistency and accuracy are important. A single incorrect entry can disrupt access to websites, APIs, or mail systems. For this reason, DNS records require careful planning and regular review.
Different DNS Records
A Record
An A record maps a hostname to an IPv4 address. It is one of the most used DNS record types. When users access a website, the resolver retrieves the A record to locate the server. Each A record contains a hostname, an IPv4 address, and a TTL (time to live). Administrators often configure multiple A records to support redundancy or load balancing.
A records usually point to web servers, application servers, or network gateways.
AAAA Record
An AAAA record maps a hostname to an IPv6 address. It provides the same function as an A record but supports the IPv6 protocol. Modern networks often publish A and AAAA records together. Systems capable of IPv6 typically prefer AAAA records during resolution. This dual-stack approach ensures compatibility with both legacy and modern network environments.
MX Record
An MX (Mail Exchange) record defines which mail servers receive email for a domain. It ensures proper routing of incoming messages. Each MX record includes a priority value. Mail servers attempt delivery starting with the lowest priority number. This design enables failover between mail servers. MX records always reference hostnames, not IP addresses. These hostnames must resolve through A or AAAA records.
TXT Record
A TXT record stores text-based data linked to a domain. Although simple in structure, it supports many advanced use cases. TXT records often store verification tokens, security policies, or configuration data for external services. Email authentication mechanisms also rely on TXT records. Applications interpret the content according to defined formats. DNS itself does not evaluate the data.
CNAME Record
A CNAME (Canonical Name) record creates an alias from one hostname to another. It allows multiple names to reference a single canonical hostname. CNAME records simplify management by centralizing configuration. Administrators can update the target hostname without changing multiple records. However, a CNAME cannot coexist with other record types for the same name.
SPF Records
An SPF (Sender Policy Framework) record specifies which servers may send email for a domain. It helps prevent sender addresses from being forged. SPF records are published as TXT records. They define allowed senders using IP addresses, hostnames, or include statements. Receiving mail servers evaluate SPF during message delivery. Incorrect configuration can cause legitimate messages to be rejected.
DKIM
DKIM (DomainKeys Identified Mail) provides cryptographic authentication for email messages. Therefore, it ensures that message content remains unchanged during transit. The public verification key is stored in a DNS TXT record. Meanwhile, the sending server signs messages with a private key. Receiving servers retrieve the key from DNS and validate the signature. As a result, DKIM strengthens domain trust and message integrity.
SRV Record
An SRV (Service) record defines the location of a specific service within a domain. It specifies the target hostname, port, and protocol. Priority and weight values support load balancing and failover. Consequently, clients can select the most appropriate service endpoint. Protocols such as SIP, XMPP, and LDAP commonly rely on SRV records for service discovery.
PTR Record
A PTR (Pointer) record enables reverse DNS lookups. Specifically, it maps an IP address back to a hostname. These records exist in dedicated reverse zones. IPv4 uses in-addr.arpa, while IPv6 uses ip6.arpa. Many mail servers require valid PTR records. Therefore, missing or incorrect entries often lead to reduced email acceptance.
NS Record
An NS (Name Server) record identifies the authoritative name servers for a DNS zone. As a result, it tells resolvers where to send queries. NS records enable distribution between zones. Parent zones rely on them to direct traffic to child zones. Correct NS configuration is essential. Otherwise, resolvers may fail to locate authoritative answers for the domain.