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 Type | Purpose | Example |
---|---|---|
A | Maps a domain name to an IPv4 address | example.com -> 192.168.1.1 |
AAAA | Maps a domain name to an IPv6 address | example.com -> 2001:db8::1 |
CNAME | Alias one domain name to another | <www.example.com> -> example.com |
MX | Specifies mail servers for the domain | example.com -> mail.example.com (Priority: 10) |
TXT | Holds text information for various purposes | example.com -> “v=spf1 include:_spf.example.com ~all” |
NS | Indicates the authoritative servers for the domain | example.com -> ns1.example.com |
SRV | Specifies the location of services | _sip._tcp.example.com -> 5 5060 sipserver.example.com |
Common DNS Command-Line Tools
-
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
-
-
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
-
-
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
-
-
whois
: Retrieves ownership and registration information for a domain.-
Basic Query:
whois example.com
-
-
ping
: Resolves a hostname to an IP address.-
Basic Ping Command:
ping example.com
-
-
traceroute
: Shows the path packets take to reach a domain.-
Basic Command:
traceroute example.com
-
-
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.