DNS By Eye provides several REST API endpoints for programmatic access:
POST /api/delegation
Content-Type: application/json
{
"domain": "example.com",
"verbose": false,
"dns_server": "system"
}
Returns: Full analysis with graphs and cross-reference data
GET /api/trace/example.com?verbose=true&dns_server=8.8.8.8
Returns: DNS delegation trace without generating graphs
GET /api/nameservers/example.com?dns_server=1.1.1.1
Returns: List of nameservers for a domain
GET /api/dns-servers
Returns: List of available public DNS servers
GET /api/health
Returns: Service health status
system
- Use system default DNS resolver8.8.8.8
- Google DNS1.1.1.1
- Cloudflare DNS9.9.9.9
- Quad9 DNS208.67.222.222
- OpenDNS# Get delegation trace using Cloudflare DNS (local)
curl -X GET "http://localhost:5000/api/trace/google.com?dns_server=1.1.1.1&verbose=true"
# Get delegation trace using live demo instance
curl -X GET "https://tools.apathy.ca/api/trace/google.com?dns_server=1.1.1.1&verbose=true"
# Full analysis with visualizations (local)
curl -X POST "http://localhost:5000/api/delegation" \
-H "Content-Type: application/json" \
-d '{"domain": "github.com", "verbose": true, "dns_server": "8.8.8.8"}'
# Full analysis with visualizations (live demo)
curl -X POST "https://tools.apathy.ca/api/delegation" \
-H "Content-Type: application/json" \
-d '{"domain": "github.com", "verbose": true, "dns_server": "8.8.8.8"}'
import requests
import json
# Base URL for the API (use live demo or local instance)
BASE_URL = "https://tools.apathy.ca" # Live demo
# BASE_URL = "http://localhost:5000" # Local instance
def trace_domain(domain, dns_server="system", verbose=False):
"""Get DNS delegation trace for a domain."""
url = f"{BASE_URL}/api/trace/{domain}"
params = {
"dns_server": dns_server,
"verbose": str(verbose).lower()
}
response = requests.get(url, params=params)
if response.status_code == 200:
return response.json()
else:
print(f"Error: {response.status_code} - {response.text}")
return None
def full_analysis(domain, dns_server="system", verbose=False):
"""Get full delegation analysis with visualizations."""
url = f"{BASE_URL}/api/delegation"
data = {
"domain": domain,
"dns_server": dns_server,
"verbose": verbose
}
response = requests.post(url, json=data)
if response.status_code == 200:
return response.json()
else:
print(f"Error: {response.status_code} - {response.text}")
return None
# Example usage
if __name__ == "__main__":
domain = "example.com"
# Simple trace
print("=== DNS Trace ===")
trace_data = trace_domain(domain, dns_server="8.8.8.8", verbose=True)
if trace_data:
for step in trace_data["trace"]:
print(f"{step['zone']}: {', '.join(step['nameservers'])}")
# Full analysis
print("\n=== Full Analysis ===")
analysis = full_analysis(domain, dns_server="1.1.1.1", verbose=True)
if analysis:
print(f"Chain: {analysis['chain']}")
print(f"Cross-reference results: {len(analysis.get('cross_ref_results', {}))}")
print(f"Graph URLs: {len(analysis.get('graph_urls', []))}")
All endpoints are rate-limited. Default limit is 100 requests per day.