Skip to main content

DNS Checker CLI

A powerful command-line tool for DNS lookups, SSL certificate inspection, and HTTP pinging.

Features

  • 🔍 DNS Record Lookup: Query A, AAAA, CNAME, MX, TXT records
  • 🔒 SSL Certificate Inspection: Detailed certificate information and expiration warnings
  • 📡 HTTP Ping: Real-time HTTP/HTTPS request monitoring with server IP change detection
  • 🎨 Rich Output: Visually rich terminal output
  • ⚙️ Custom Nameserver: Specify custom DNS servers for queries

Installation

Requirements

  • Python 3.7 or higher

Installation Steps

# Clone the repository
git clone <repository-url>
cd dns-checker-cli

# Create virtual environment (recommended)
python -m venv venv
source venv/bin/activate  # macOS/Linux
# or
venv\Scripts\activate  # Windows

# Install dependencies
pip install -r requirements.txt

# Install in development mode
pip install -e .

Usage

DNS Record Lookup

Query DNS records for a domain.

# Basic usage
dns-checker dns example.com

# Use custom nameserver
dns-checker dns example.com --nameserver 8.8.8.8
dns-checker dns example.com -n 1.1.1.1

SSL Certificate Inspection

Query both DNS information and SSL certificate for a domain.

# Basic usage
dns-checker inspect example.com

# Use custom nameserver
dns-checker inspect example.com --nameserver 8.8.8.8

Output Information:

  • DNS records (A, AAAA, CNAME, MX, TXT)
  • SSL certificate issuer and subject
  • Certificate validity period
  • SAN (Subject Alternative Names)
  • Signature algorithm
  • Expiration warning (within 30 days)

HTTP Ping

Periodically send HTTP/HTTPS requests to monitor server status.

# Basic usage (1 second interval, infinite loop)
dns-checker httping https://example.com

# Specify interval (2 seconds)
dns-checker httping https://example.com --interval 2
dns-checker httping https://example.com -i 2

# Specify count (10 times)
dns-checker httping https://example.com --count 10
dns-checker httping https://example.com -c 10

# Use custom nameserver
dns-checker httping https://example.com --nameserver 8.8.8.8

# Force connection to specific IP (keep domain but change IP)
dns-checker httping https://naver.com --server 223.130.200.219
dns-checker httping https://example.com -s 93.184.216.34

# Combined usage
dns-checker httping https://example.com -i 2 -c 20 -n 8.8.8.8 -s 93.184.216.34

Output Information:

  • Response time (milliseconds)
  • HTTP status code
  • Server IP address
  • Content-Length (response size)
  • Content-Type (response type)
  • IP change detection (migration monitoring)
  • Forced IP connection indicator
  • Statistics (average/min/max response time, success rate)

Stop: Press Ctrl+C to stop and display statistics.

Usage Examples

Domain Migration Monitoring

# Monitor domain during migration to new server
dns-checker httping https://mysite.com -i 5

# Server IP changes will be highlighted

Test with Specific IP

# Request to specific IP while keeping domain as naver.com
# Host header remains naver.com, works with virtual host environments
dns-checker httping https://naver.com --server 223.130.200.219 -c 5

# Test new server before migration
dns-checker httping https://mysite.com --server 192.168.1.100 -c 10

DNS Propagation Check

# Check DNS records with multiple nameservers
dns-checker dns example.com -n 8.8.8.8
dns-checker dns example.com -n 1.1.1.1
dns-checker dns example.com -n 208.67.222.222

SSL Certificate Expiration Check

# Check certificate expiration date
dns-checker inspect example.com

# Warning displayed if expiring within 30 days

Options

Common Options

  • --help: Show help message
  • --version: Show version information

DNS Command Options

  • --nameserver, -n: Custom nameserver IP address

Inspect Command Options

  • --nameserver, -n: Custom nameserver IP address

HTTPing Command Options

  • --interval, -i: Request interval in seconds (default: 1)
  • --count, -c: Number of requests (infinite if not specified)
  • --nameserver, -n: Custom nameserver IP address
  • --server, -s: Force connection to specific server IP (keep domain but use specific IP)

Development

Development Environment Setup

# Install development dependencies
make dev

# Or manually
pip install -r requirements.txt
pip install pytest pytest-cov pytest-mock flake8 black
pip install -e .

Running Tests

# Using Makefile (recommended)
make test           # Run all tests
make test-cov       # Run tests with coverage

# Or run directly
pytest
pytest tests/test_dns_service.py
pytest --cov=dns_checker

Code Quality

make lint           # Run code linting
make format         # Format code
make verify         # Full verification (lint + tests)

Build and Deploy

make build          # Build package
make upload-test    # Upload to TestPyPI
make upload         # Upload to PyPI
make release        # Full release (test → build → upload)

For more details, see PYPI_UPLOAD_GUIDE.md.

Code Style

This project follows the PEP 8 style guide.

Dependencies

  • click>=8.0.0: CLI framework
  • dnspython>=2.0.0: DNS queries
  • cryptography>=3.4.0: SSL certificate parsing
  • requests>=2.25.0: HTTP requests
  • rich>=10.0.0: Terminal output formatting

License

MIT License

Contributing

Issues and pull requests are welcome!

Metadata

Release files for dns-checker-cli 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dns-checker-cli 0.1.1
File Size Uploaded
dns_checker_cli-0.1.1.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dns-checker-cli 0.1.1
File Interpreter ABI Platform
dns_checker_cli-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 36.5 kB

Release files / dns_checker_cli-0.1.1.tar.gz

Download URL dns_checker_cli-0.1.1.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7826a52248e0a8533504a026e5e9e267fefceedc054bb47fd6ae5be346833253
BLAKE2b-256 checksum
How to use checksums
682296b1a926b5ec3d291438afbc96d768c75745197b1c01408d523bd4952ba0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / dns_checker_cli-0.1.1-py3-none-any.whl

Download URL dns_checker_cli-0.1.1-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b275c3b49ca36012cc257cca9a386175d1ae4fc9f547a128678472d37ddeae07
BLAKE2b-256 checksum
How to use checksums
3ff00828c87c93af54f329b9024427fa50f1033cfbbff9a8e143b88b4fe20a9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page