Sobes.tech
Intern

What do DNS records mean?

sobes.tech AI

Answer from AI

DNS (Domain Name System) records link human-readable domain names (e.g., example.com) with IP addresses and other information necessary for internet functioning. Each record has a specific type indicating its purpose.

Main types of DNS records and their purposes:

  • A (Address Record): Links a domain name to an IPv4 address.
    // Links example.com to an IPv4 address
    example.com.        IN    A    192.168.1.1
    
  • AAAA (IPv6 Address Record): Links a domain name to an IPv6 address.
    // Links example.com to an IPv6 address
    example.com.        IN    AAAA    2001:0db8::1
    
  • CNAME (Canonical Name Record): Creates an alias for another domain name. A query to the alias will be redirected to the main domain name.
    // www.example.com is an alias for example.com
    www.example.com.    IN    CNAME    example.com.
    
  • MX (Mail Exchanger Record): Specifies mail servers responsible for receiving email for the domain. Includes priority.
    // Mail exchanger with priority 10 pointing to mail.example.com
    example.com.        IN    MX    10    mail.example.com.
    // Mail exchanger with priority 20 pointing to anothermail.example.com
    example.com.        IN    MX    20    anothermail.example.com.
    
  • TXT (Text Record): Stores textual information that can be used for various purposes, such as domain ownership verification, SPF (Sender Policy Framework), or DKIM (DomainKeys Identified Mail).
    // Example SPF record
    example.com.        IN    TXT    "v=spf1 include:_spf.google.com ~all"
    
  • NS (Name Server Record): Indicates authoritative DNS servers for the domain or subdomain.
    // ns1.example.com is an authoritative name server for example.com
    example.com.        IN    NS    ns1.example.com.
    // ns2.example.com is an authoritative name server for example.com
    example.com.        IN    NS    ns2.example.com.
    
  • PTR (Pointer Record): Used for reverse DNS resolution - converting an IP address to a domain name. Located in in-addr.arpa (for IPv4) or ip6.arpa (for IPv6) zones.
    // Reverse resolution for 192.168.1.1
    1.1.168.192.in-addr.arpa.    IN    PTR    example.com.
    
  • SRV (Service Record): Indicates the location (hostname and port) of servers for a specific service.
    // Server for the _sip._tcp service on example.com, port 5060, priority 10, weight 5
    _sip._tcp.example.com.    IN    SRV    10    5    5060    sipserver.example.com.
    

Each record also has a Time To Live (TTL), indicating how long DNS resolvers should cache the response.

Example of a general record structure:

// <name>    [TTL]    [class]    <record type>    <data>

The class is usually IN (Internet).