/dnsleaf

Python thin wrapper to ask popular providers to recache your dns records

Primary LanguagePython

leafdns logo

A Python library and CLI tool for flushing DNS caches across multiple providers.

Installation

pip install dnsleaf

Supported Providers

Provider Documentation Stability
Cloudflare API Docs Beta
Google Public DNS Docs Beta

Library Usage

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")

CLI Usage

# 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