Skip to content

Free domain registration and practical DNS learning resources for everyone.

2.5 KB
Raw Blame

Command Reference

Replace example names and documentation addresses before using these commands.

Registration and Delegation

dig NS example.dpdns.org
dig +trace NS example.dpdns.org
dig SOA example.dpdns.org

Direct Authoritative Queries

dig @ns1.dns-service.example SOA example.dpdns.org
dig @ns1.dns-service.example A example.dpdns.org
dig +tcp @ns1.dns-service.example SOA example.dpdns.org

Website Records

dig A example.dpdns.org
dig AAAA example.dpdns.org
dig CNAME www.example.dpdns.org
dig CAA example.dpdns.org

Email Records

dig MX example.dpdns.org
dig TXT example.dpdns.org
dig TXT selector1._domainkey.example.dpdns.org
dig TXT _dmarc.example.dpdns.org

Short Answers

dig +short A example.dpdns.org
dig +short NS example.dpdns.org

Short output is convenient for scripts but removes useful flags, authority, and TTL context. Use normal output during diagnosis.

HTTP and Redirects

curl -I http://example.dpdns.org
curl -I https://example.dpdns.org
curl -L -o /dev/null -s -w '%{http_code} %{url_effective}\n' http://www.example.dpdns.org

Test a Virtual Host Before DNS

curl -I -H 'Host: example.dpdns.org' http://192.0.2.10
curl --resolve example.dpdns.org:443:192.0.2.10 -I https://example.dpdns.org

The HTTPS command validates the certificate for the hostname while connecting to the selected address.

TLS Certificate

openssl s_client -connect example.dpdns.org:443 -servername example.dpdns.org </dev/null

Summarize certificate fields:

openssl s_client -connect example.dpdns.org:443 -servername example.dpdns.org </dev/null 2>/dev/null \
  | openssl x509 -noout -subject -issuer -dates -ext subjectAltName

Local Listening Ports

Linux:

sudo ss -lntup

macOS:

lsof -nP -iTCP -sTCP:LISTEN

Web Server Checks

sudo nginx -t
systemctl status nginx --no-pager
journalctl -u nginx --since '30 minutes ago' --no-pager

Connectivity

nc -vz example.dpdns.org 80
nc -vz example.dpdns.org 443

A successful TCP connection does not prove that HTTP, TLS, or the application is correct.

Save Diagnostic Output

{
  date -u
  dig NS example.dpdns.org
  dig A example.dpdns.org
  curl -I --max-time 15 https://example.dpdns.org
} > domain-diagnostic.txt 2>&1

Review the file and remove personal data, internal hostnames, tokens, cookies, and unrelated output before sharing it.

Continue to Website Architecture Patterns.