Skip to main content

Python client for the DNS Robot API — DNS lookups, WHOIS, SSL checks, SPF/DKIM/DMARC validation, and more.

Project description

dnsrobot

Python client for the DNS Robot API — 53 free online DNS and network tools.

No API key required. Zero external dependencies.

Install

pip install dnsrobot

Quick Start

from dnsrobot import DNSRobot

dr = DNSRobot()

# DNS lookup
result = dr.dns_lookup("example.com")
for ip in result["resolvedIPs"]:
    print(ip)

# WHOIS lookup
whois = dr.whois_lookup("example.com")
print(f"Registrar: {whois['registrar']['name']}")
print(f"Expires: {whois['expiresOn']}")

# SSL certificate check
ssl = dr.ssl_check("github.com")
print(f"Valid: {ssl['leafCertificate']['isValid']}")
print(f"Days left: {ssl['leafCertificate']['daysToExpire']}")

Available Methods

Method Description Tool Page
dns_lookup(domain) DNS record lookup (A, AAAA, MX, TXT, etc.) DNS Lookup
whois_lookup(domain) WHOIS registration data WHOIS Lookup
ssl_check(domain) SSL/TLS certificate check SSL Checker
spf_check(domain) SPF record validation SPF Checker
dkim_check(domain) DKIM record check DKIM Checker
dmarc_check(domain) DMARC record validation DMARC Checker
mx_lookup(domain) MX record lookup MX Lookup
ns_lookup(domain) Nameserver lookup NS Lookup
ip_lookup(ip) IP geolocation IP Lookup
http_headers(url) HTTP header analysis HTTP Headers
port_check(host, port) TCP port check Port Checker

Examples

Email authentication check

dr = DNSRobot()

spf = dr.spf_check("gmail.com")
print(f"SPF: {spf['grade']} ({spf['score']}/100)")

dkim = dr.dkim_check("gmail.com", selector="google")
print(f"DKIM found: {dkim['found']}")

dmarc = dr.dmarc_check("gmail.com")
print(f"DMARC policy: {dmarc['policy']}")

MX and NS records

dr = DNSRobot()

mx = dr.mx_lookup("gmail.com")
for rec in mx["mxRecords"]:
    print(f"{rec['priority']} {rec['exchange']}")

ns = dr.ns_lookup("google.com")
for srv in ns["nameservers"]:
    print(srv["nameserver"])

Port scanning

dr = DNSRobot()

for port in [22, 80, 443, 8080]:
    result = dr.port_check("example.com", port)
    print(f"Port {port}: {result['status']}")

Error Handling

from dnsrobot import DNSRobot

dr = DNSRobot()

try:
    result = dr.dns_lookup("example.com")
except RuntimeError as e:
    print(f"API error: {e}")
except ValueError as e:
    print(f"Invalid input: {e}")

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dnsrobot-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dnsrobot-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file dnsrobot-0.1.0.tar.gz.

File metadata

  • Download URL: dnsrobot-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dnsrobot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 678f64472bb31d3e0908f9ec1341dfc156bfcc6b48be07a8abbf6582434b6366
MD5 eed10717dfa6649da60b25d4b9da737d
BLAKE2b-256 cd9889bd6efed6b5872536a9eb888007482a10ecae68743c7031160da9e61f55

See more details on using hashes here.

File details

Details for the file dnsrobot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dnsrobot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dnsrobot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6b741a3fd40d46fb580fc592a0483e1a46c32c2ee636cd98441a9a28572342a
MD5 93202ef948a7f15d1cf463b702a40e72
BLAKE2b-256 dd106408e5e3f9a00fcb5ab0dde0a8af0f9d92d7cbeafe8d6d2a55d51d4ce202

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page