What is a DNS record?

DNS records (aka zone files) are instructions that live in authoritative DNS servers and provide information about a domain including what IP address is associated with that domain and how to handle requests for that domain. These records consist of a series of text files written in what is known as DNS syntax. DNS syntax is just a string of characters used as commands that tell the DNS server what to do. All DNS records also have a ‘TTL’, which stands for time-to-live, and indicates how often a DNS server will refresh that record.

DNS record
DNS record

You can think of a set of DNS records like a business listing on Yelp. That listing will give you a bunch of useful information about a business such as their location, hours, services offered, etc. All domains are required to have at least a few essential DNS records for a user to be able to access their website using a domain name, and there are several optional records that serve additional purposes.

What are the most common types of DNS record?

  • A record – The record that holds the IP address of a domain.
  • AAAA record – The record that contains the IPv6 address for a domain (as opposed to A records, which list the IPv4 address).
  • CNAME record – Forwards one domain or subdomain to another domain, does NOT provide an IP address.
  • MX record – Directs mail to an email server.
  • TXT record – Lets an admin store text notes in the record. These records are often used for email security.
  • NS record – Stores the name server for a DNS entry.
  • SOA record – Stores admin information about a domain.
  • SRV record – Specifies a port for specific services.
  • PTR record – Provides a domain name in reverse-lookups.DNS RecordDNS (Domain Name System) records are essential components of the DNS infrastructure that translate human-readable domain names (e.g., example.com) into machine-readable IP addresses (e.g., 192.0.2.1). DNS records are stored in DNS servers and are used to manage various aspects of domain name resolution and internet services. Each DNS record serves a specific purpose and directs traffic to different destinations.

    Here are some common types of DNS records and their purposes:

    DNS Record

    1. A (Address) Record:

    • Purpose: Maps a domain name to an IPv4 address.
    • Example: example.com IN A 192.0.2.1

    2. AAAA (IPv6 Address) Record:

    • Purpose: Maps a domain name to an IPv6 address.
    • Example: example.com IN AAAA 2001:0db8:85a3:0000:0000:8a2e:0370:7334

    3. CNAME (Canonical Name) Record:

    • Purpose: Creates an alias or canonical name for an existing A or AAAA record.
    • Example: www.example.com IN CNAME example.com

    4. MX (Mail Exchange) Record:

    • Purpose: Specifies the mail servers responsible for receiving email messages on behalf of a domain.
    • Example: example.com IN MX 10 mail.example.com

    5. TXT (Text) Record:

    • Purpose: Stores arbitrary text data associated with a domain, often used for domain verification, SPF records, and DKIM signatures.
    • Example: example.com IN TXT "v=spf1 mx -all"

    6. NS (Name Server) Record:

    • Purpose: Specifies the authoritative name servers for a domain, indicating which DNS servers are responsible for resolving DNS queries for that domain.
    • Example: example.com IN NS ns1.example.com

    7. PTR (Pointer) Record:

    • Purpose: Performs reverse DNS lookups, mapping an IP address to a domain name.
    • Example: 1.2.3.4 IN PTR example.com

    8. SRV (Service) Record:

    • Purpose: Specifies the location of services (e.g., SIP, XMPP) on the domain.
    • Example: _sip._tcp.example.com IN SRV 10 60 5060 sipserver.example.com

    9. SOA (Start of Authority) Record:

    • Purpose: Provides authoritative information about the domain, including the primary name server, email of the domain administrator, and various timing parameters.
    • Example: example.com IN SOA ns1.example.com admin.example.com 2022010101 3600 1800 604800 3600

    These DNS records work together to facilitate domain name resolution, email delivery, service discovery, and other critical internet functions. Proper management and configuration of DNS records are essential for maintaining the accessibility and functionality of domain names and associated services.