DNS & WHOIS Tools
Investigation toolkit for DNS, WHOIS, IP reputation, and passive-DNS work. Applies to any domain or IP across public internet domains.
DNS lookup — preferred order
wsl dig — fullest output, supports +short, +noall +answer, ANY, AXFR, etc.
- Google DNS API —
curl -s "https://dns.google/resolve?name=DOMAIN&type=A" — works from any shell, returns JSON.
nslookup — works but some local resolvers may return "No response from server". Use only when 1 and 2 are unavailable.
Current DNS records
# A / NS / MX / CNAME / TXT via Google DNS-over-HTTPS
curl -s "https://dns.google/resolve?name=DOMAIN&type=A|NS|MX|CNAME|TXT"
# Indexed subdomains (HackerTarget)
curl -s "https://api.hackertarget.com/hostsearch/?q=DOMAIN"
Historical / passive DNS
Use these when "what nameservers did this domain use before migrating?" or "what DNS records existed historically?" matters. They reveal records that no longer resolve.
- crt.sh (Certificate Transparency):
curl -s "https://crt.sh/?q=%.DOMAIN&output=json" — reveals subdomains that ever had SSL issued (indirect evidence they existed).
- SecurityTrails —
https://securitytrails.com/domain/DOMAIN/dns (WebFetch; may require account).
- WhoisFreaks —
https://whoisfreaks.com/tools/dns/history/lookup/DOMAIN (WebFetch).
- DNSHistory.org —
https://dnshistory.org/dns-records/DOMAIN (WebFetch).
- ViewDNS.info —
https://viewdns.info/history/?domain=DOMAIN (WebFetch).
Priority order for historical nameservers: SecurityTrails (preferred, comprehensive history) → WhoisFreaks → ViewDNS.info → DNS provider customer support.
WHOIS — domain ownership and registrar information
- who.is —
https://who.is/whois/DOMAIN (WebFetch).
- ICANN Lookup —
https://lookup.icann.org/en/lookup?name=DOMAIN (WebFetch).
wsl whois DOMAIN for shells with whois available.
Note: some ccTLDs (.in, .de, .uk, etc.) do not expose public WHOIS for the registrant due to regional privacy regulations.
IP reputation
ipinfo.io (organization, ASN, hostname, geolocation)
curl -s "https://ipinfo.io/IP/json"
Returns: organization name, ASN, reverse hostname, country, city, ISP.
AbuseIPDB (abuse score for blacklist / nullroute decisions)
The API key should be stored in a secure vault (e.g., Bitwarden, environment variable, credential manager). Reference it as an environment variable ABUSEIPDB_API_KEY — never hardcode it.
curl -G https://api.abuseipdb.com/api/v2/check \
--data-urlencode "ipAddress=IP" \
-H "Key: $ABUSEIPDB_API_KEY" \
-H "Accept: application/json"
If ABUSEIPDB_API_KEY is not set in the current shell, retrieve it securely and export it for the session (export ABUSEIPDB_API_KEY=... on Bash / $env:ABUSEIPDB_API_KEY=... on PowerShell) — do not print the value to stdout or logs.
Registrar ≠ hosting provider — critical rule
Never assume the registrar (WHOIS registrant) is also the hosting provider. They are independent business relationships: a domain can be registered at GoDaddy but hosted at Linode, or registered at Namecheap and hosted at AWS.
To find historical nameservers (e.g., "what was the NS before the domain was migrated?"):
- Start with SecurityTrails:
https://securitytrails.com/domain/DOMAIN/dns — shows NS history and A-record history with timestamps.
- Fall through to WhoisFreaks → ViewDNS.info → contact the domain owner/administrator.
- Never infer historical nameservers from the current WHOIS record. WHOIS shows who sold the domain (registrar), not the hosting history (nameservers).
Example: A domain registered at GoDaddy (registrar) may have been hosted at AWS (NS: ns-123.awsdns-45.com), then migrated to Cloudflare (NS: nora.ns.cloudflare.com). The WHOIS registrant info does not change, but the NS records do. Historical DNS records reveal the path.
Subdomain enumeration
- HackerTarget — indexed subdomains (passive crawl):
curl -s "https://api.hackertarget.com/hostsearch/?q=DOMAIN".
- crt.sh — subdomains from SSL certificates (Certificate Transparency logs):
curl -s "https://crt.sh/?q=%.DOMAIN&output=json".
- Combine both for coverage: HackerTarget finds indexed DNS entries; crt.sh finds domains that had HTTPS active at some point in CT logs.
When to use each tool
| Tool |
Use Case |
dig / Google DNS API |
Real-time DNS records, current state |
| crt.sh |
Historical subdomains, certificates, broad discovery |
| SecurityTrails |
Historical NS records, DNS changes over time |
| WHOIS (ICANN / who.is) |
Registrant, registrar, registration date, contact info |
| ipinfo.io |
IP organization, ASN, geolocation, reverse hostname |
| AbuseIPDB |
Abuse history, blacklist score, reporter comments |
| HackerTarget |
Indexed subdomains from search engines and DNS scans |
Common workflows
"Find who hosts this domain"
- Get current NS:
curl -s "https://dns.google/resolve?name=DOMAIN&type=NS"
- Cross-reference with known hosting NS prefixes (e.g.,
*.awsdns*.com = AWS, *.cloudflare.com = Cloudflare, *.linode.com = Linode).
- Optionally verify with
ipinfo.io on the A record IP.
"Find historical nameservers before a migration"
- Start with SecurityTrails:
https://securitytrails.com/domain/DOMAIN/dns
- If not available, try WhoisFreaks or ViewDNS.info.
- Compare historical NS with current NS to identify the migration path.
"Check if an IP is reputation-flagged"
curl -s "https://ipinfo.io/IP/json" — basic info.
curl -G https://api.abuseipdb.com/api/v2/check --data-urlencode "ipAddress=IP" -H "Key: $ABUSEIPDB_API_KEY" -H "Accept: application/json" — abuse score.
"Enumerate all subdomains of a domain"
curl -s "https://crt.sh/?q=%.DOMAIN&output=json" — CT logs.
curl -s "https://api.hackertarget.com/hostsearch/?q=DOMAIN" — indexed scans.
- Combine results and de-duplicate.
Related skills
- Shell selection and CLI tooling → see your project's or organization's guidance on shell environments and available tools.
- IP-based investigations (traceroute, MTR, geolocation) → use system tools and public APIs (ipinfo.io, MaxMind, etc.).
1---2name: dns-and-whois-tools3description: DNS lookup, WHOIS, passive-DNS history, IP reputation, and subdomain enumeration procedures. Auto-load when nslookup / dig / whois / host is mentioned, when investigating DNS records (A, NS, MX, CNAME, TXT), when researching historical nameservers, when checking IP reputation (AbuseIPDB, ipinfo.io), when enumerating subdomains (HackerTarget, crt.sh, SecurityTrails), or when reasoning about registrar vs hosting provider.4---56# DNS & WHOIS Tools78Investigation toolkit for DNS, WHOIS, IP reputation, and passive-DNS work. Applies to any domain or IP across public internet domains.910## DNS lookup — preferred order11121. **`wsl dig`** — fullest output, supports `+short`, `+noall +answer`, `ANY`, `AXFR`, etc.132. **Google DNS API** — `curl -s "https://dns.google/resolve?name=DOMAIN&type=A"` — works from any shell, returns JSON.143. **`nslookup`** — works but some local resolvers may return "No response from server". Use only when 1 and 2 are unavailable.1516## Current DNS records1718```bash19# A / NS / MX / CNAME / TXT via Google DNS-over-HTTPS20curl -s "https://dns.google/resolve?name=DOMAIN&type=A|NS|MX|CNAME|TXT"2122# Indexed subdomains (HackerTarget)23curl -s "https://api.hackertarget.com/hostsearch/?q=DOMAIN"24```2526## Historical / passive DNS2728Use these when "what nameservers did this domain use before migrating?" or "what DNS records existed historically?" matters. They reveal records that no longer resolve.2930- **crt.sh** (Certificate Transparency): `curl -s "https://crt.sh/?q=%.DOMAIN&output=json"` — reveals subdomains that ever had SSL issued (indirect evidence they existed).31- **SecurityTrails** — `https://securitytrails.com/domain/DOMAIN/dns` (WebFetch; may require account).32- **WhoisFreaks** — `https://whoisfreaks.com/tools/dns/history/lookup/DOMAIN` (WebFetch).33- **DNSHistory.org** — `https://dnshistory.org/dns-records/DOMAIN` (WebFetch).34- **ViewDNS.info** — `https://viewdns.info/history/?domain=DOMAIN` (WebFetch).3536Priority order for historical nameservers: SecurityTrails (preferred, comprehensive history) → WhoisFreaks → ViewDNS.info → DNS provider customer support.3738## WHOIS — domain ownership and registrar information3940- **who.is** — `https://who.is/whois/DOMAIN` (WebFetch).41- **ICANN Lookup** — `https://lookup.icann.org/en/lookup?name=DOMAIN` (WebFetch).42- **`wsl whois DOMAIN`** for shells with `whois` available.4344**Note:** some ccTLDs (`.in`, `.de`, `.uk`, etc.) do not expose public WHOIS for the registrant due to regional privacy regulations.4546## IP reputation4748### ipinfo.io (organization, ASN, hostname, geolocation)4950```bash51curl -s "https://ipinfo.io/IP/json"52```5354Returns: organization name, ASN, reverse hostname, country, city, ISP.5556### AbuseIPDB (abuse score for blacklist / nullroute decisions)5758The API key should be stored in a secure vault (e.g., Bitwarden, environment variable, credential manager). Reference it as an environment variable `ABUSEIPDB_API_KEY` — never hardcode it.5960```bash61curl -G https://api.abuseipdb.com/api/v2/check \62 --data-urlencode "ipAddress=IP" \63 -H "Key: $ABUSEIPDB_API_KEY" \64 -H "Accept: application/json"65```6667If `ABUSEIPDB_API_KEY` is not set in the current shell, retrieve it securely and export it for the session (`export ABUSEIPDB_API_KEY=...` on Bash / `$env:ABUSEIPDB_API_KEY=...` on PowerShell) — do not print the value to stdout or logs.6869## Registrar ≠ hosting provider — critical rule7071**Never assume the registrar (WHOIS registrant) is also the hosting provider.** They are independent business relationships: a domain can be registered at GoDaddy but hosted at Linode, or registered at Namecheap and hosted at AWS.7273To find **historical nameservers** (e.g., "what was the NS before the domain was migrated?"):7475- Start with SecurityTrails: `https://securitytrails.com/domain/DOMAIN/dns` — shows NS history and A-record history with timestamps.76- Fall through to WhoisFreaks → ViewDNS.info → contact the domain owner/administrator.77- **Never infer historical nameservers from the current WHOIS record.** WHOIS shows who sold the domain (registrar), not the hosting history (nameservers).7879**Example:** A domain registered at GoDaddy (registrar) may have been hosted at AWS (NS: ns-123.awsdns-45.com), then migrated to Cloudflare (NS: nora.ns.cloudflare.com). The WHOIS registrant info does not change, but the NS records do. Historical DNS records reveal the path.8081## Subdomain enumeration8283- **HackerTarget** — indexed subdomains (passive crawl): `curl -s "https://api.hackertarget.com/hostsearch/?q=DOMAIN"`.84- **crt.sh** — subdomains from SSL certificates (Certificate Transparency logs): `curl -s "https://crt.sh/?q=%.DOMAIN&output=json"`.85- **Combine both** for coverage: HackerTarget finds indexed DNS entries; crt.sh finds domains that had HTTPS active at some point in CT logs.8687## When to use each tool8889| Tool | Use Case |90|---|---|91| `dig` / Google DNS API | Real-time DNS records, current state |92| crt.sh | Historical subdomains, certificates, broad discovery |93| SecurityTrails | Historical NS records, DNS changes over time |94| WHOIS (ICANN / who.is) | Registrant, registrar, registration date, contact info |95| ipinfo.io | IP organization, ASN, geolocation, reverse hostname |96| AbuseIPDB | Abuse history, blacklist score, reporter comments |97| HackerTarget | Indexed subdomains from search engines and DNS scans |9899## Common workflows100101### "Find who hosts this domain"1021031. Get current NS: `curl -s "https://dns.google/resolve?name=DOMAIN&type=NS"`1042. Cross-reference with known hosting NS prefixes (e.g., `*.awsdns*.com` = AWS, `*.cloudflare.com` = Cloudflare, `*.linode.com` = Linode).1053. Optionally verify with `ipinfo.io` on the A record IP.106107### "Find historical nameservers before a migration"1081091. Start with SecurityTrails: `https://securitytrails.com/domain/DOMAIN/dns`1102. If not available, try WhoisFreaks or ViewDNS.info.1113. Compare historical NS with current NS to identify the migration path.112113### "Check if an IP is reputation-flagged"1141151. `curl -s "https://ipinfo.io/IP/json"` — basic info.1162. `curl -G https://api.abuseipdb.com/api/v2/check --data-urlencode "ipAddress=IP" -H "Key: $ABUSEIPDB_API_KEY" -H "Accept: application/json"` — abuse score.117118### "Enumerate all subdomains of a domain"1191201. `curl -s "https://crt.sh/?q=%.DOMAIN&output=json"` — CT logs.1212. `curl -s "https://api.hackertarget.com/hostsearch/?q=DOMAIN"` — indexed scans.1223. Combine results and de-duplicate.123124## Related skills125126- Shell selection and CLI tooling → see your project's or organization's guidance on shell environments and available tools.127- IP-based investigations (traceroute, MTR, geolocation) → use system tools and public APIs (ipinfo.io, MaxMind, etc.).