Sure! Below is the combined cheat sheet that includes both the DNS records table and the command-line tools for querying and managing DNS.


DNS Cheat Sheet

Overview

The Domain Name System (DNS) is a hierarchical naming system used to translate human-readable domain names (e.g., <www.example.com>) into numerical IP addresses (e.g., 192.0.2.1) required for locating and identifying computer services and devices.

Common DNS Record Types

Record TypePurposeExample
AMaps a domain name to an IPv4 addressexample.com -> 192.168.1.1
AAAAMaps a domain name to an IPv6 addressexample.com -> 2001:db8::1
CNAMEAlias one domain name to another<www.example.com> -> example.com
MXSpecifies mail servers for the domainexample.com -> mail.example.com (Priority: 10)
TXTHolds text information for various purposesexample.com -> “v=spf1 include:_spf.example.com ~all”
NSIndicates the authoritative servers for the domainexample.com -> ns1.example.com
SRVSpecifies the location of services_sip._tcp.example.com -> 5 5060 sipserver.example.com

Common DNS Command-Line Tools

  1. nslookup: Utility for querying the DNS.

    • Basic Query:

      nslookup example.com
      
    • Query a Specific Record Type (e.g., MX):

      nslookup -query=MX example.com
      
    • Use a Specific DNS Server:

      nslookup example.com 8.8.8.8
      
  2. dig (Domain Information Groper): Advanced tool for DNS queries.

    • Basic Query:

      dig example.com
      
    • Query a Specific Record Type (e.g., CNAME):

      dig example.com CNAME
      
    • Query with Detailed Output:

      dig +short example.com
      
    • Query a Specific DNS Server:

      dig @8.8.8.8 example.com
      
  3. host: Simple utility for DNS lookups.

    • Basic Query:

      host example.com
      
    • Query a Specific Record Type (e.g., A):

      host -t A example.com
      
    • Query a Specific Record Type (e.g., MX):

      host -t MX example.com
      
  4. whois: Retrieves ownership and registration information for a domain.

    • Basic Query:

      whois example.com
      
  5. ping: Resolves a hostname to an IP address.

    • Basic Ping Command:

      ping example.com
      
  6. traceroute: Shows the path packets take to reach a domain.

    • Basic Command:

      traceroute example.com
      
  7. dig for DNSSEC (if enabled):

    • Query a DNSKEY Record:

      dig example.com DNSKEY
      
    • Query a DS Record:

      dig example.com DS
      

Summary

Understanding both DNS record types and common command-line tools is essential for effective domain management and troubleshooting DNS-related issues. These commands will help you query and verify DNS configurations efficiently.