A Python library and CLI tool for flushing DNS caches across multiple providers.
pip install dnsleaf
Provider | Documentation | Stability |
---|---|---|
Cloudflare | API Docs | Beta |
Public DNS Docs | Beta |
from dns_flush import DNSCacheFlusher, DNSRecord
async def main():
# Initialize flusher
flusher = DNSCacheFlusher()
# Create record
record = DNSRecord(domain="example.com", record_type="A")
# Flush all providers
results = await flusher.flush_all(record)
# Or flush specific provider
result = await flusher.flush_provider(record, "cloudflare")
# Flush all providers
dnsleaf flush example.com
# Flush specific provider
dnsleaf flush example.com --provider cloudflare
# Specify record type
dnsleaf flush example.com --record-type A
# Get JSON output
dnsleaf flush example.com --json-output