-
-
Notifications
You must be signed in to change notification settings - Fork 97
DNS Lookup
CarterPerez-dev edited this page Feb 11, 2026
·
1 revision
Professional DNS reconnaissance tool for security research and network analysis.
A CLI tool that performs DNS queries, reverse lookups, resolution tracing, WHOIS lookups, and batch domain reconnaissance. Unlike simple dig wrappers, this implements concurrent async DNS queries, resolution path tracing from root servers, and structured output formatting.
Status: Complete | Difficulty: Beginner
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.13+ | Async support |
| Typer | - | CLI framework |
| Rich | - | Terminal formatting |
| dnspython | - | DNS protocol operations |
| asyncio | - | Concurrent queries |
- Multi-type DNS record queries (A, AAAA, MX, NS, TXT, CNAME, SOA)
- Reverse DNS lookups (IPv4 and IPv6 PTR records)
- DNS resolution trace from root servers through TLD to authoritative nameservers
- Batch operations with concurrent async queries
- WHOIS domain registration lookups
- Custom DNS server selection
- JSON output for automation
- Reconnaissance techniques used in penetration testing
- DNS infrastructure enumeration (MITRE T1590.002)
- Understanding DNS hijacking (Sea Turtle, DNSpionage campaigns)
- Detecting DNS tunneling and cache poisoning
- Investigating suspicious domains during incident response
User Command
↓
cli.py (Typer: query, reverse, trace, batch, whois)
↓
┌──────────────────┬──────────────────┐
│ resolver.py │ whois_lookup.py │
│ Async DNS │ Domain │
│ operations │ registration │
│ (~400 lines) │ details │
└──────────────────┴──────────────────┘
↓
output.py (Rich formatting, ~400 lines)
↓
Terminal Display
cd PROJECTS/beginner/dns-lookup
# Install dependencies
uv sync
# Query all record types
uv run dnslookup query example.com
# Specific records with custom server
uv run dnslookup query example.com --type A,MX --server 8.8.8.8
# Trace resolution path
uv run dnslookup trace example.com
# Reverse lookup
uv run dnslookup reverse 8.8.8.8
# Batch reconnaissance
echo "example.com" > domains.txt
uv run dnslookup batch domains.txt --output results.json
# WHOIS lookup
uv run dnslookup whois example.comdns-lookup/
├── src/dnslookup/
│ ├── cli.py # Typer command interface
│ ├── resolver.py # Core DNS logic
│ ├── output.py # Rich terminal formatting
│ └── whois_lookup.py # WHOIS operations
├── tests/
└── pyproject.toml
# Run tests
uv run pytest tests/ -v
# Linting
uv run ruff check .
# Format
uv run ruff format .©AngelaMos | CertGames.com | CarterPerez-dev | 2026