Page:
DNS Lookup
Pages
API Rate Limiter
API Security Scanner
Base64 Tool
Bug Bounty Platform
Caesar Cipher
Certification Roadmaps
Contributing
DNS Lookup
Docker Security Audit
Encrypted P2P Chat
Getting Started
Home
Keylogger
Metadata Scrubber Tool
Network Traffic Analyzer
Project Roadmap
SIEM Dashboard
Simple Port Scanner
Simple Vulnerability Scanner
Tools and Resources
1
DNS Lookup
CarterPerez-dev edited this page 2026-02-11 04:56:38 -05:00
DNS Lookup
Professional DNS reconnaissance tool for security research and network analysis.
Overview
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
Tech Stack
| Technology | Version | Purpose |
|---|---|---|
| Python | 3.13+ | Async support |
| Typer | - | CLI framework |
| Rich | - | Terminal formatting |
| dnspython | - | DNS protocol operations |
| asyncio | - | Concurrent queries |
Features
Core Functionality
- 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
Security Relevance
- 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
Architecture
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
Quick Start
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.com
Project Structure
dns-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
Development
# Run tests
uv run pytest tests/ -v
# Linting
uv run ruff check .
# Format
uv run ruff format .
Source Code
Navigation
Beginner Projects
- Simple Port Scanner
- Keylogger
- Caesar Cipher
- DNS Lookup Tool
- Vulnerability Scanner
- Metadata Scrubber
- Network Traffic Analyzer
- Base64 Encoder/Decoder
Intermediate Projects
Advanced Projects
Guides
Resources
Progress: 14/60
©AngelaMos | CertGames.com | CarterPerez-dev | 2026