A comprehensive Python CLI tool and package for domain analysis and profiling. Gather detailed information about domains including DNS records, website characteristics, domain registration data, and security indicators.
- Comprehensive DNS Records: Query all standard DNS record types (A, AAAA, MX, TXT, NS, SOA, CNAME, etc.)
- IP Resolution: Get all IP addresses associated with a domain
- Reverse DNS Lookup: Resolve IP addresses back to hostnames
- Domain Aliases: Discover domain aliases and CNAME records
- Site Availability: Check if website is accessible
- Security Indicators: Detect potential phishing characteristics
- Domain Registration: Age, registration length, and WHOIS data
- Redirects: Track HTTP redirects and URL changes
- Favicon Analysis: Extract and hash favicons for fingerprinting
- Content Analysis: Form detection, popup detection, and more
- Suspicious URL pattern detection
- Abnormal port usage detection
- Subdomain enumeration
- File extension analysis
- DNSSEC validation — verifies the full chain of trust (DNSKEY self-signature
- parent DS match), distinguishing
secure/bogus/insecure, and flags weak signing algorithms
- parent DS match), distinguishing
- CAA policy analysis — reports which CAs may issue certificates, climbing the DNS tree as a CA would, and flags "any CA may issue" / missing iodef contact
- RDAP registration data — structured registrar, registration/expiry dates, EPP status codes, nameservers, and DNSSEC delegation
- TLS certificate inspection — issuer, validity window, SAN coverage, key strength; flags self-signed, expired, very-fresh, SAN-mismatch, and untrusted-chain certificates
- Subdomain-takeover & wildcard detection — detects wildcard DNS (baseline) and dangling CNAMEs pointing at unprovisioned takeover-prone providers
- SPF — record lookup with
include/redirecttree expansion and a flattened view of authorized senders - DKIM — probes common (and any user-supplied) selectors for signing keys
- DMARC — policy, alignment, and reporting-address parsing
- BIMI — brand-indicator record discovery
- MX — mail-exchanger records backing the domain
- Scores a candidate domain against a known brand — edit-distance similarity, homoglyph normalization (Cyrillic/Greek/digit look-alikes), and IDN/punycode decoding to catch homograph attacks
pip install domain-profilergit clone https://github.com/sublime-security/domain-profiler.git
cd domain-profiler
pip install -e .uv add domain-profiler# DNS-only analysis (fast)
domain-profiler run example.com
# Full analysis including website profiling
domain-profiler run example.com --live
# Include email-authentication analysis (SPF, DKIM, DMARC, BIMI, MX)
domain-profiler run example.com --email
# Include security analysis (DNSSEC, CAA, RDAP, TLS, takeover)
domain-profiler run example.com --security
# Security analysis only
domain-profiler security example.com
# Email-authentication analysis only
domain-profiler email example.com
# Probe a specific DKIM selector first
domain-profiler email example.com --dkim-selector google
# Inspect just the TLS certificate
domain-profiler tls example.com
# Check for wildcard DNS / dangling-CNAME takeover risk
domain-profiler takeover example.com
# Score a candidate domain against a brand for typosquatting
domain-profiler typosquat paypa1.com --brand paypal.comfrom domain_profiler import Profiler
# Create profiler instance
profiler = Profiler()
# DNS analysis only
dns_data = profiler.run("example.com")
# Full analysis with website profiling
full_data = profiler.run("example.com", live=True)
# Email-authentication analysis (SPF / DKIM / DMARC / BIMI / MX)
email_data = profiler.run("example.com", email=True)
# ...or standalone:
email_only = profiler.email("example.com")
# Security analysis (DNSSEC / CAA / RDAP / TLS / subdomain-takeover)
security_data = profiler.run("example.com", security=True)
# ...or standalone:
security_only = profiler.security("example.com")
print(full_data)The CLI is built using Google Fire, providing an intuitive interface:
domain-profiler run DOMAIN [--live] [--email] [--dkim-selector SELECTOR] [--security]DOMAIN: The domain to analyze (required)--live: Enable website analysis in addition to DNS (optional, default: False)--email: Enable email-authentication analysis — SPF/DKIM/DMARC/BIMI/MX (optional, default: False)--dkim-selector: Extra DKIM selector to probe first (optional)--security: Enable security analysis — DNSSEC/CAA/RDAP/TLS/subdomain-takeover (optional, default: False)
# Basic DNS analysis
domain-profiler run google.com
# Full analysis with website profiling
domain-profiler run https://example.com --live
# Analysis with IP address
domain-profiler run 8.8.8.8The tool returns structured JSON data containing:
{
"domain": "example.com",
"aliases": ["www.example.com"],
"ips": {
"93.184.216.34": {
"host": "example.com",
"fqdn": "example.com",
"reverse": {...}
}
},
"dns": {
"A": ["93.184.216.34"],
"MX": ["0 ."],
"NS": ["a.iana-servers.net.", "b.iana-servers.net."],
"TXT": ["v=spf1 -all"]
}
}When using --live flag, additional website data is included:
- URL parsing details (scheme, netloc, path, etc.)
- Site availability status
- HTTPS availability
- Security indicators
- Domain registration information
- Favicon hashes
- Page title
The tool uses several robust Python libraries:
- dnspython: DNS resolution and analysis (including DNSSEC/CAA/email records)
- cryptography: TLS certificate parsing and inspection
- requests-html: Website content analysis with JavaScript support
- beautifulsoup4: HTML parsing and analysis
- python-whois: Domain registration information
- fire: Command-line interface generation
- pendulum: Date/time handling
- mmh3: Favicon hashing
# Clone the repository
git clone https://github.com/sublime-security/domain-profiler.git
cd domain-profiler
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install in development mode
pip install -e .domain-profiler/
├── src/domain_profiler/
│ ├── __init__.py
│ ├── __main__.py # CLI entry point
│ ├── profiler.py # Main profiler class
│ ├── dns.py # DNS analysis functionality
│ ├── site.py # Website analysis functionality
│ ├── email_auth.py # SPF/DKIM/DMARC/BIMI/MX analysis
│ ├── dnssec.py # DNSSEC chain-of-trust validation
│ ├── caa.py # CAA policy analysis
│ ├── rdap.py # RDAP registration data
│ ├── tls.py # TLS certificate inspection
│ ├── takeover.py # Subdomain-takeover & wildcard detection
│ ├── typosquat.py # Typosquat / homoglyph detection
│ ├── base.py # Base classes and utilities
│ └── logger.py # Logging configuration
├── pyproject.toml # Project configuration
├── README.md
└── uv.lock # Dependency lock file
# Install development dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run tests with coverage
pytest --cov=domain_profiler --cov-report=html
# Run tests in parallel
pytest -n auto
# Run specific test categories
pytest -m unit # Unit tests only
pytest -m integration # Integration tests only
pytest -m "not slow" # Skip slow tests
# Run specific test files
pytest tests/test_profiler.py
pytest tests/test_dns.py
pytest tests/test_site.py
pytest tests/test_email_auth.py
pytest tests/test_tls.py
# Run with verbose output
pytest -v
# Generate coverage report
pytest --cov=domain_profiler --cov-report=term-missingThe test suite includes comprehensive coverage of all modules:
tests/test_profiler.py: Main profiler functionality, CLI integrationtests/test_dns.py: DNS resolution, record queries, IP lookupstests/test_site.py: Website analysis, security indicators, WHOIS datatests/test_email_auth.py: SPF/DKIM/DMARC/BIMI/MX resolution and parsingtests/test_dnssec.py: DNSSEC chain-of-trust validationtests/test_caa.py: CAA policy analysistests/test_rdap.py: RDAP registration-data parsingtests/test_tls.py: TLS certificate inspection and security flagstests/test_takeover.py: Wildcard DNS and dangling-CNAME detectiontests/test_typosquat.py: Typosquat / homoglyph scoringtests/test_cli.py: Command-line interface, Fire integrationtests/test_base.py: Base classes, inheritance, extensionstests/test_logger.py: Logging system, formatters, metaclass
- Comprehensive Mocking: All external dependencies (DNS, HTTP, WHOIS) are mocked
- Edge Case Coverage: Error handling, timeouts, invalid inputs
- Parametrized Tests: Multiple input variations and scenarios
- Integration Tests: End-to-end functionality testing
- Coverage Reporting: HTML and terminal coverage reports
- Parallel Execution: Fast test runs with pytest-xdist
- Analyze suspicious domains for phishing indicators
- Investigate domain infrastructure and hosting
- Track domain reputation and history
- Monitor DNS configuration changes
- Verify domain accessibility and redirects
- Check SSL/TLS certificate deployment
- Analyze competitor domain infrastructure
- Track website technology changes
- Monitor domain registration patterns
- DNS-only analysis: Fast, typically completes in 1-3 seconds
- Live analysis: Slower due to website requests, may take 5-15 seconds
- Timeout handling: Built-in timeouts prevent hanging on unresponsive sites
- Error resilience: Gracefully handles network errors and invalid domains
The tool is designed to be resilient:
- Network timeouts are handled gracefully
- Invalid domains return partial data where possible
- HTTPS/HTTP fallback for website analysis
- Comprehensive logging for debugging
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
The project includes a comprehensive test suite with 300+ tests spanning DNS, website, email-authentication, and security analysis, hardened with mutation testing.
# Run all tests
make test
# Run tests with coverage report
make test-coverage
# Run tests in parallel (faster)
make test-fast- ✅ 300+ tests passing across 13 test modules
- 🎯 Dedicated suites for every analysis module (DNS, site, email, DNSSEC, CAA, RDAP, TLS, takeover, typosquat)
- 🧬 Mutation-tested to verify tests actually catch regressions
- 🔧 Comprehensive mocking of all external dependencies
- 🚀 No real network calls during testing
- Email-authentication analysis (
--email/email): SPF (with tree expansion and flattening), DKIM selector probing, DMARC, BIMI, and MX - Tier 1 DNS-layer security (
--security/security): DNSSEC chain-of-trust validation, CAA policy analysis, and RDAP registration data - Tier 2 security signals: TLS certificate inspection (
tls), subdomain-takeover and wildcard detection (takeover), and typosquat/homoglyph scoring (typosquat) - Test suite expanded to 300+ tests and hardened with mutation testing
- Initial release
- DNS analysis functionality
- Website profiling with live mode
- CLI interface with Fire
- Comprehensive domain reporting
- Full test suite with 149 tests and 85% coverage
- Issues: GitHub Issues
- Documentation: This README and inline code documentation
- Python Version: Requires Python 3.11+
This tool is intended for legitimate security research, infrastructure monitoring, and educational purposes. Please ensure you have proper authorization before analyzing domains you do not own or control.