Linux Networking: DNS, HTTP, and TLS Testing

DNS troubleshooting, resolver inspection, HTTP probing, and TLS certificate testing from Linux.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## DNS Resolution
Query A record
dig +short example.com A

# Fetch an A record in short output format.

Query MX record
dig +short example.com MX

# Fetch MX records in short format.

Trace DNS delegation
dig +trace example.com

# Follow delegation from root to authoritative answers.

Query a specific resolver
dig @1.1.1.1 example.com

# Send a DNS query to a chosen DNS server.

Resolve with host
host example.com

# Look up DNS records with the host command.

Resolve with nslookup
nslookup example.com 8.8.8.8

# Interactive or one-shot DNS lookup.

Show systemd-resolved status
resolvectl status

# Inspect current DNS servers and search domains.

Query through systemd-resolved
resolvectl query example.com

# Resolve a domain using resolvectl.

Resolve through NSS
getent hosts example.com

# Query host resolution through glibc NSS.

Inspect resolver config
cat /etc/resolv.conf

# Show the resolver configuration file.

## HTTP and TLS Testing
Fetch response headers
curl -I https://example.com

# Make a HEAD request to inspect headers.

Verbose HTTP request
curl -v https://example.com

# Display request and response details.

Override DNS for one request
curl --resolve example.com:443:203.0.113.10 https://example.com

# Pin a host:port to a chosen IP address.

Send request from interface
curl --interface eth0 https://example.com

# Use a specific local interface for outbound traffic.

Use an HTTP proxy
curl -x http://proxy.example.com:3128 https://example.com

# Send an HTTP request through a proxy.

Inspect TLS certificate chain
openssl s_client -connect example.com:443 -servername example.com

# Open a TLS session and print certificate details.

Show certificate dates
openssl x509 -in cert.pem -noout -dates

# Print notBefore and notAfter fields from a certificate file.

Test URL availability
wget --spider -S https://example.com

# Check whether a URL is reachable without downloading content.

Recommended next

No recommendations yet.