A comprehensive, production-ready network diagnostic API powered by Cloudflare Workers featuring 18 professional-grade tools for network analysis, security auditing, and troubleshooting.
- DNS Lookup - Query any DNS record type via Cloudflare's DoH
- HTTP/HTTPS Checker - Test endpoint health and performance
- IP Geolocation - Get visitor location and network info
- Headers Inspector - View all request headers
- Ping/Latency Test - Measure response times with statistics
- SSL/TLS Certificate Inspector - Validate HTTPS security
- SPF Record Checker - Email authentication validation
- DMARC Checker - Email policy and security
- Security Headers Analyzer - Grade website security posture
- WHOIS Lookup - Domain registration info via RDAP
- HTTP Version Checker - Detect HTTP/2 & HTTP/3 support
- Reverse DNS - PTR record lookups
- Port Connectivity - TCP port testing with Cloudflare Sockets
- Subnet Calculator - CIDR network calculations
- Base64 Encoder/Decoder - String encoding utilities
- Hash Generator - Cryptographic hashes (SHA-1/256/384/512)
- URL Parser - Parse and analyze URLs
- User Agent Parser - Detect browser, OS, device type
- Node.js 18 or later
- A Cloudflare account (free tier works!)
- Wrangler CLI:
npm install -g wrangler
# Install dependencies
npm install
# Generate TypeScript types
npm run types
# Login to Cloudflare
wrangler login
# Run locally
npm run dev
# Deploy to production
npm run deployhttps://YOUR-WORKER.workers.dev
Query DNS records using Cloudflare's DNS over HTTPS (DoH).
Endpoint: GET /dns
Parameters:
domain(required) - Domain name to querytype(optional, default: A) - Record type: A, AAAA, MX, TXT, NS, CNAME, SOA, CAA
Example:
curl "https://YOUR-WORKER.workers.dev/dns?domain=cloudflare.com&type=A"Response:
{
"tool": "dns",
"timestamp": "2026-02-16T10:00:00.000Z",
"executionTime": 42,
"result": {
"domain": "cloudflare.com",
"type": "A",
"status": "success",
"answers": [
{
"name": "cloudflare.com",
"type": 1,
"TTL": 300,
"data": "104.16.132.229"
}
],
"authority": []
}
}Test endpoint health, status codes, and response time.
Endpoint: GET /http-check
Parameters:
url(required) - Full URL to check
Example:
curl "https://YOUR-WORKER.workers.dev/http-check?url=https://cloudflare.com"Response:
{
"tool": "http-check",
"executionTime": 150,
"result": {
"url": "https://cloudflare.com",
"status": 200,
"statusText": "OK",
"ok": true,
"responseTime": 148,
"headers": {
"content-type": "text/html",
"server": "cloudflare"
},
"redirected": false
}
}Get your IP address and geographic information.
Endpoint: GET /ip-info
Parameters: None
Example:
curl "https://YOUR-WORKER.workers.dev/ip-info"Response:
{
"tool": "ip-info",
"executionTime": 2,
"result": {
"ip": "203.0.113.42",
"country": "US",
"city": "San Francisco",
"continent": "NA",
"latitude": "37.7749",
"longitude": "-122.4194",
"timezone": "America/Los_Angeles",
"asn": "13335",
"colo": "SFO"
}
}Inspect all request headers including Cloudflare metadata.
Endpoint: GET /headers
Parameters: None
Example:
curl "https://YOUR-WORKER.workers.dev/headers"Measure response time with ping-like statistics.
Endpoint: GET /ping
Parameters:
url(required) - Full URL to pingcount(optional, default: 4, max: 10) - Number of pings
Example:
curl "https://YOUR-WORKER.workers.dev/ping?url=https://cloudflare.com&count=5"Response:
{
"tool": "ping",
"executionTime": 2500,
"result": {
"url": "https://cloudflare.com",
"count": 5,
"results": [
{ "seq": 1, "time": 120, "status": 200, "ok": true },
{ "seq": 2, "time": 115, "status": 200, "ok": true }
],
"statistics": {
"min": 115,
"max": 122,
"avg": 118,
"loss": "0%"
}
}
}Check SSL/TLS certificate validity and security.
Endpoint: GET /ssl or GET /certificate
Parameters:
domain(required) - Domain or full URL to check
Example:
curl "https://YOUR-WORKER.workers.dev/ssl?domain=cloudflare.com"Domain registration information via RDAP protocol.
Endpoint: GET /whois
Parameters:
domain(required) - Domain name
Example:
curl "https://YOUR-WORKER.workers.dev/whois?domain=cloudflare.com"Response:
{
"tool": "whois",
"executionTime": 650,
"result": {
"domain": "cloudflare.com",
"registrar": "MarkMonitor Inc.",
"status": ["clientTransferProhibited"],
"created": "2009-02-17T00:00:00Z",
"updated": "2024-01-16T00:00:00Z",
"expires": "2025-02-17T00:00:00Z",
"nameservers": ["ns1.cloudflare.com", "ns2.cloudflare.com"]
}
}Validate Sender Policy Framework records for email authentication.
Endpoint: GET /spf
Parameters:
domain(required) - Domain name
Example:
curl "https://YOUR-WORKER.workers.dev/spf?domain=cloudflare.com"Response:
{
"tool": "spf",
"executionTime": 120,
"result": {
"domain": "cloudflare.com",
"exists": true,
"record": "v=spf1 include:_spf.cloudflare.com ~all",
"mechanisms": ["v=spf1", "include:_spf.cloudflare.com", "~all"],
"dnsLookups": 1,
"valid": true,
"warnings": []
}
}Check DMARC policy and email security configuration.
Endpoint: GET /dmarc
Parameters:
domain(required) - Domain name
Example:
curl "https://YOUR-WORKER.workers.dev/dmarc?domain=cloudflare.com"Response:
{
"tool": "dmarc",
"executionTime": 130,
"result": {
"domain": "cloudflare.com",
"exists": true,
"record": "v=DMARC1; p=reject; rua=mailto:[email protected]",
"policy": "reject",
"subdomainPolicy": "reject",
"percentage": "100",
"reportingAddresses": {
"aggregate": "mailto:[email protected]",
"forensic": "none"
}
}
}Analyze security headers and grade website security posture.
Endpoint: GET /security-headers
Parameters:
url(required) - Full URL to analyze
Example:
curl "https://YOUR-WORKER.workers.dev/security-headers?url=https://cloudflare.com"Response:
{
"tool": "security-headers",
"executionTime": 200,
"result": {
"url": "https://cloudflare.com",
"headers": {
"Strict-Transport-Security": "max-age=31536000",
"Content-Security-Policy": "default-src 'self'",
"X-Frame-Options": "DENY",
"X-Content-Type-Options": "nosniff",
"Referrer-Policy": "no-referrer"
},
"score": "8/9",
"grade": "A"
}
}Detect HTTP/2 and HTTP/3 support.
Endpoint: GET /http-version
Parameters:
url(required) - Full URL to check
Example:
curl "https://YOUR-WORKER.workers.dev/http-version?url=https://cloudflare.com"Perform reverse DNS lookup (PTR record).
Endpoint: GET /reverse-dns
Parameters:
ip(required) - IPv4 address
Example:
curl "https://YOUR-WORKER.workers.dev/reverse-dns?ip=1.1.1.1"Response:
{
"tool": "reverse-dns",
"executionTime": 80,
"result": {
"ip": "1.1.1.1",
"hostnames": ["one.one.one.one"],
"found": true
}
}Test TCP port connectivity using Cloudflare Sockets.
Endpoint: GET /port-check
Parameters:
host(required) - Hostname or IP addressport(required) - Port number (1-65535, except 25)
Example:
curl "https://YOUR-WORKER.workers.dev/port-check?host=cloudflare.com&port=443"Response:
{
"tool": "port-check",
"executionTime": 150,
"result": {
"host": "cloudflare.com",
"port": 443,
"open": true,
"responseTime": 148
}
}Note: Port 25 (SMTP) is blocked by Cloudflare Workers.
Calculate network information from CIDR notation.
Endpoint: GET /subnet
Parameters:
cidr(required) - CIDR notation (e.g., 192.168.1.0/24)
Example:
curl "https://YOUR-WORKER.workers.dev/subnet?cidr=192.168.1.0/24"Response:
{
"tool": "subnet",
"executionTime": 1,
"result": {
"cidr": "192.168.1.0/24",
"network": "192.168.1.0",
"broadcast": "192.168.1.255",
"netmask": "255.255.255.0",
"wildcardMask": "0.0.0.255",
"firstHost": "192.168.1.1",
"lastHost": "192.168.1.254",
"totalHosts": 256,
"usableHosts": 254,
"prefix": 24
}
}Encode or decode Base64 strings.
Endpoint: GET /base64
Parameters:
input(required) - String to encode/decodeop(optional, default: encode) - Operation:encodeordecode
Example:
# Encode
curl "https://YOUR-WORKER.workers.dev/base64?input=Hello%20World&op=encode"
# Decode
curl "https://YOUR-WORKER.workers.dev/base64?input=SGVsbG8gV29ybGQ=&op=decode"Generate cryptographic hashes.
Endpoint: GET /hash
Parameters:
input(required) - String to hashalgo(optional, default: SHA-256) - Algorithm: SHA-1, SHA-256, SHA-384, SHA-512
Example:
curl "https://YOUR-WORKER.workers.dev/hash?input=Hello%20World&algo=SHA-256"Response:
{
"tool": "hash",
"executionTime": 2,
"result": {
"input": "Hello World",
"algorithm": "SHA-256",
"hash": "a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"
}
}Parse URL into components.
Endpoint: GET /url-parse
Parameters:
url(required) - URL to parse
Example:
curl "https://YOUR-WORKER.workers.dev/url-parse?url=https://example.com:8080/path?key=value%23hash"Response:
{
"tool": "url-parse",
"executionTime": 1,
"result": {
"original": "https://example.com:8080/path?key=value#hash",
"protocol": "https:",
"hostname": "example.com",
"port": "8080",
"pathname": "/path",
"search": "?key=value",
"hash": "#hash",
"origin": "https://example.com:8080",
"params": { "key": "value" }
}
}Detect browser, OS, and device type from User-Agent.
Endpoint: GET /user-agent
Parameters: None (uses your request's User-Agent header)
Example:
curl "https://YOUR-WORKER.workers.dev/user-agent"Response:
{
"tool": "user-agent",
"executionTime": 1,
"result": {
"userAgent": "Mozilla/5.0 ...",
"browser": "Chrome",
"os": "Windows",
"deviceType": "desktop",
"isBot": false
}
}This Worker follows all Cloudflare Workers best practices:
β
Streaming - HTTP responses stream without buffering (no memory overflow)
β
Background Tasks - Uses ctx.waitUntil() for caching and analytics
β
No Global State - All state passed through function arguments
β
Caching - DNS (5min) and WHOIS (1hr) results cached in KV
β
TypeScript - Full type safety with generated Env types
β
Modern Config - wrangler.jsonc with nodejs_compat
β
Observability - Logs (100%) and traces (10%) enabled
β
Structured Logging - JSON logs for searchability
β
Error Handling - Try/catch with detailed error responses
β
CORS Support - Ready for cross-origin API access
β
TCP Sockets - Uses Cloudflare's connect() API for port checking
β
Web Crypto - Secure hash generation with Web Crypto API
To enable caching, create a KV namespace:
wrangler kv:namespace create CACHEUpdate wrangler.jsonc with the returned namespace ID.
No environment variables or secrets required! All tools work out of the box.
View logs and traces in the Cloudflare dashboard:
- Workers β Your Worker β Observability
- Or use:
npm run tail
- Global Edge Deployment - 300+ cities worldwide
- Sub-50ms Response Times - For most tools
- Intelligent Caching - DNS (5min), WHOIS (1hr) TTL
- Rate Limiting - CPU time limit: 50ms per request
- CORS Enabled -
Access-Control-Allow-Origin: *for public API - Input Validation - All parameters validated before processing
- Timeout Protection - 10s for HTTP requests, 5s for pings
- No Secrets Logged - Structured logging excludes sensitive data
- Port 25 Blocked - SMTP port blocked per Cloudflare policy
Contributions welcome! Areas for improvement:
- Additional DNS record types
- More security header checks
- IPv6 support for more tools
- WebSocket connectivity testing
- MTU path discovery
MIT License - Use freely for any purpose!
- DevOps & SRE - Quick network diagnostics from anywhere
- Security Audits - Check SPF, DMARC, security headers
- API Development - Test endpoints, check headers, validate URLs
- Network Troubleshooting - DNS, reverse DNS, port connectivity
- Educational - Learn about networking protocols and security
Built with β€οΈ using Cloudflare Workers
Deploy globally in seconds. Run at the edge. Scale automatically.