Professional DNS lookup CLI with beautiful Rich output
Project description
DNS Lookup Tool
Professional DNS lookup CLI with beautiful Rich terminal output. Query DNS records, perform reverse lookups, trace resolution paths, and retrieve WHOIS information.
Features
- Multi-Record Queries: Query A, AAAA, MX, NS, TXT, CNAME, SOA records
- Reverse DNS: IP to hostname resolution
- DNS Trace: Visualize the resolution path from root to authoritative servers
- Batch Lookups: Query multiple domains concurrently
- WHOIS Integration: Domain registration information
- JSON Export: Machine-readable output for scripting
- Beautiful Output: Color-coded tables, spinners, and tree visualizations
Installation
# Clone the repository
git clone https://github.com/CarterPerez-dev/Cybersecurity-Projects.git
cd PROJECTS/dns-lookup
# Install with uv
uv sync
# Or install with pip
python -m venv .venv
source .venv/bin/activate
pip install -e .
Usage
Basic DNS Query
# Query all record types
dnslookup query example.com
# Query specific record types
dnslookup query example.com --type A,MX,TXT
# Use custom DNS server
dnslookup query example.com --server 8.8.8.8
# Output as JSON
dnslookup query example.com --json
Reverse DNS Lookup
# IPv4
dnslookup reverse 8.8.8.8
# IPv6
dnslookup reverse 2606:4700:4700::1111
DNS Trace
Trace the resolution path from root servers to authoritative nameservers:
dnslookup trace example.com
dnslookup trace example.com --type MX
Batch Lookups
Query multiple domains from a file:
# Create a file with domains (one per line)
echo -e "google.com\ngithub.com\ncloudflare.com" > domains.txt
# Run batch lookup
dnslookup batch domains.txt
# Save results to JSON
dnslookup batch domains.txt --output results.json
WHOIS Lookup
dnslookup whois example.com
dnslookup whois google.com --json
Example Output
DNS Query
๐ DNS Lookup: example.com
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ DNS Records โ
โโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโค
โ Type โ Value โ TTL โ
โโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโค
โ A โ 93.184.216.34 โ 1h โ
โ AAAA โ 2606:2800:220:1:... โ 1h โ
โ MX โ mail.example.com (10) โ 1d โ
โ NS โ ns1.example.com โ 2d โ
โโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโ
โ Found 8 records in 45ms
DNS Trace
๐ DNS Trace: example.com
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ DNS Resolution Path
โโโ [.] Root
โ โโโ โ a.root-servers.net (198.41.0.4)
โ โโโ Referred to com. servers
โโโ [com.] TLD
โ โโโ โ a.gtld-servers.net (192.5.6.30)
โ โโโ Referred to example.com NS
โโโ [example.com.] Authoritative
โโโ โ ns1.example.com (93.184.216.34)
โโโ A: 93.184.216.34
โ Resolution complete: 93.184.216.34
Development
# Install dev dependencies
just install-dev
# Run the tool
just run query example.com
# Run tests
just test
# Lint code
just lint
# Format code
just ruff-fix
# Run all checks
just ci
Available Commands
| Command | Description |
|---|---|
just run *ARGS |
Run the CLI tool |
just test |
Run test suite |
just lint |
Run ruff linter |
just ruff-fix |
Auto-fix and format |
just mypy |
Type checking |
just ci |
Run all checks |
just clean |
Remove cache files |
Few Examples
License
MIT License - See LICENSE for details.
Author
CarterPerez-dev
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dnslookup_cli-0.1.1.tar.gz.
File metadata
- Download URL: dnslookup_cli-0.1.1.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
62e1622c8cc44258cad06239ac440b2e08c19641426190520c6bc9e62896c472
|
|
| MD5 |
4d8c1bbd14037e79036098933f7b9fb4
|
|
| BLAKE2b-256 |
53a455b8c4706b7bb295d2dc12486c8c0adfac82f05d560c87d704c1986f810a
|
Provenance
The following attestation bundles were made for dnslookup_cli-0.1.1.tar.gz:
Publisher:
publish-dns-lookup.yml on CarterPerez-dev/Cybersecurity-Projects
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dnslookup_cli-0.1.1.tar.gz -
Subject digest:
62e1622c8cc44258cad06239ac440b2e08c19641426190520c6bc9e62896c472 - Sigstore transparency entry: 753633552
- Sigstore integration time:
-
Permalink:
CarterPerez-dev/Cybersecurity-Projects@26d9fa1c2949f0516a2264e82febc4291a8dd902 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/CarterPerez-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-dns-lookup.yml@26d9fa1c2949f0516a2264e82febc4291a8dd902 -
Trigger Event:
push
-
Statement type:
File details
Details for the file dnslookup_cli-0.1.1-py3-none-any.whl.
File metadata
- Download URL: dnslookup_cli-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60b405b014ace73d6d369102938ac1ca7fa1551691437b2b1d43b90073f27207
|
|
| MD5 |
dabd5b27a38fcd0bc6011de14131d0ff
|
|
| BLAKE2b-256 |
8e8f8d072e85d4ce3acf7d57458adda6affb5cab13bbe87834780c659700b0c9
|
Provenance
The following attestation bundles were made for dnslookup_cli-0.1.1-py3-none-any.whl:
Publisher:
publish-dns-lookup.yml on CarterPerez-dev/Cybersecurity-Projects
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dnslookup_cli-0.1.1-py3-none-any.whl -
Subject digest:
60b405b014ace73d6d369102938ac1ca7fa1551691437b2b1d43b90073f27207 - Sigstore transparency entry: 753633561
- Sigstore integration time:
-
Permalink:
CarterPerez-dev/Cybersecurity-Projects@26d9fa1c2949f0516a2264e82febc4291a8dd902 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/CarterPerez-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-dns-lookup.yml@26d9fa1c2949f0516a2264e82febc4291a8dd902 -
Trigger Event:
push
-
Statement type: