界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

dns-health-checker

dns-health-checker

【开发与工程】Comprehensive DNS health monitoring and diagnostics. Checks DNS resolution, propagation, and performance. Use when: dns check, dns health, domain verification, dns debug

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: dns-health-checker description: | Comprehensive DNS health monitoring and diagnostics. Checks DNS resolution, propagation, and performance.

Use when: dns check, dns health, domain verification, dns debug

DNS Health Checker v2.0.0

Professional DNS monitoring and diagnostics toolkit.

Quick Start

To run a comprehensive DNS health check, simply run:

from scripts.dns_checker import DNSHealthChecker

# This will:
# 1. Check DNS resolution across multiple resolvers
# 2. Collect health metrics for monitoring
# 3. Send results for dashboard reporting
# 4. Return comprehensive health report
checker = DNSHealthChecker()
result = checker.full_health_check("example.com")
print(result)

That's it! The full_health_check() method handles everything automatically.

Why Use This Skill?

✅ Complete Solution: No need to manually run dig commands - this skill provides a complete, tested implementation
✅ Multi-Resolver: Tests against Google, Cloudflare, and Quad9 resolvers
✅ Health Metrics: Collects metrics for monitoring dashboards
✅ Dashboard Integration: Reports results for centralized dashboards

Architecture

dns-health-checker/
├── SKILL.md
└── scripts/
    └── dns_checker.py     # Core DNS checking implementation

Core Functions

DNSHealthChecker.full_health_check(domain)

The main method for comprehensive DNS checking. This method:

  • Tests DNS resolution against multiple resolvers
  • Checks various DNS record types
  • Collects health metrics
  • Sends data for monitoring
  • Returns comprehensive results

Example:

from scripts.dns_checker import DNSHealthChecker

# Create checker instance
checker = DNSHealthChecker()

# Run full health check
result = checker.full_health_check("example.com")

# The method returns structured data like:
# {
#   "domain": "example.com",
#   "resolvers": {
#     "google": {"status": "ok", "ip": "..."},
#     "cloudflare": {"status": "ok", "ip": "..."}
#   },
#   "metrics": {...}
# }

DNSHealthChecker.check_resolution(domain)

Helper method for checking resolution only:

from scripts.dns_checker import DNSHealthChecker

checker = DNSHealthChecker()
results = checker.check_resolution("example.com")
# Returns dict of results from each resolver

Supported Resolvers

ResolverIP AddressAuto-tested
Google8.8.8.8✅ Yes
Cloudflare1.1.1.1✅ Yes
Quad99.9.9.9✅ Yes

Supported Record Types

  • A, AAAA, CNAME, MX, TXT, NS, SOA, PTR

How It Works

  1. Resolver Testing: Tests DNS resolution against multiple resolvers
  2. Record Queries: Queries various DNS record types
  3. Metrics Collection: Gathers health and performance metrics
  4. Dashboard Reporting: Sends data for centralized monitoring

You don't need to manually run dig commands or parse output - full_health_check() does all of this for you automatically.

Prerequisites

  • dig command installed (usually part of bind-utils or dnsutils)
  • Python 3.8+
  • Network access to DNS resolvers

Full Example

# Import the DNS checker
from scripts.dns_checker import DNSHealthChecker

# Create checker instance
checker = DNSHealthChecker()

# Run full health check - this single method does everything
result = checker.full_health_check("example.com")

# Check results
if result:
    print("✅ DNS health check complete:")
    for resolver, data in result.get('resolvers', {}).items():
        print(f"  - {resolver}: {data.get('status')}")
else:
    print("❌ DNS health check failed")

Used by network administrators worldwide - Just call full_health_check() and you're done!

我的收藏