net_benchmark.dns_benchmark.core

Core DNS benchmarking functionality.

Classes

DNSQueryEngine([max_concurrent_queries, ...])

Async DNS query engine with rate limiting and retry logic.

DNSQueryResult(resolver_ip, resolver_name, ...)

Result of a single DNS query.

DomainManager()

Manage domain lists with comprehensive database.

QueryProtocol(value[, names, module, ...])

QueryStatus(value[, names, module, ...])

ResolverManager()

Manage DNS resolver configurations with comprehensive database.

class net_benchmark.dns_benchmark.core.QueryStatus(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

SUCCESS = 'success'
TIMEOUT = 'timeout'
NXDOMAIN = 'nxdomain'
SERVFAIL = 'servfail'
CONNECTION_REFUSED = 'connection_refused'
UNKNOWN_ERROR = 'unknown_error'
DNSSEC_FAILED = 'dnssec_failed'
TLS_ERROR = 'tls_error'
class net_benchmark.dns_benchmark.core.QueryProtocol(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

PLAIN = 'plain'
DOH = 'doh'
DOT = 'dot'
class net_benchmark.dns_benchmark.core.DNSQueryResult(resolver_ip, resolver_name, domain, record_type, start_time, end_time, latency_ms, status, answers, ttl, error_message=None, attempt_number=1, cache_hit=False, dnssec_validated=False, protocol=QueryProtocol.PLAIN, iteration=1, query_id=<factory>)[source]

Bases: object

Result of a single DNS query.

resolver_ip: str
resolver_name: str
domain: str
record_type: str
start_time: float
end_time: float
latency_ms: float
status: QueryStatus
answers: List[str]
ttl: Optional[int]
error_message: Optional[str] = None
attempt_number: int = 1
cache_hit: bool = False
dnssec_validated: bool = False
protocol: QueryProtocol = 'plain'
iteration: int = 1
query_id: str
to_dict()[source]
Return type:

Dict[str, Any]

class net_benchmark.dns_benchmark.core.DNSQueryEngine(max_concurrent_queries=100, timeout=5.0, max_retries=2, enable_cache=False, retry_backoff_multiplier=0.1, retry_backoff_base=2.0, enable_dnssec=False, enforce_dnssec=False)[source]

Bases: object

Async DNS query engine with rate limiting and retry logic.

set_progress_callback(callback)[source]

Set callback for progress updates with completed/total counts.

Return type:

None

async close()[source]

Close all shared DoH clients and DoT connections.

Must be awaited after run_benchmark completes — especially important in FastAPI where connections are reused across requests.

Return type:

None

async query_single(resolver_ip, resolver_name, domain, record_type='A', use_cache=True, iteration=1)[source]

Execute a single DNS query with retry logic and caching.

Return type:

DNSQueryResult

async query_single_doh(resolver_ip, resolver_name, domain, doh_url, record_type='A', iteration=1)[source]

Execute a single DNS-over-HTTPS query.

Return type:

DNSQueryResult

async query_single_dot(resolver_ip, resolver_name, domain, record_type='A', port=853, iteration=1)[source]

Execute a single DNS-over-TLS query.

Reuses a pooled TLS connection per resolver to avoid handshake overhead on every query. Connection is evicted from the pool on any error so the next query gets a fresh connection.

Return type:

DNSQueryResult

async run_benchmark(resolvers, domains, record_types=None, iterations=1, warmup=False, warmup_fast=False, use_cache=False, protocol=QueryProtocol.PLAIN, doh_urls=None)[source]

Run benchmark across all resolvers and domains.

Parameters:
  • resolvers (List[Dict[str, str]]) – List of resolver dicts with ‘ip’ and ‘name’ keys

  • domains (List[str]) – List of domain names to query

  • record_types (Optional[List[str]]) – List of DNS record types (default: [“A”])

  • iterations (int) – Number of times to repeat the benchmark

  • warmup (bool) – Run full warmup (all resolvers × all domains × all record types)

  • warmup_fast (bool) – Run fast warmup (one probe per resolver, overrides warmup)

  • use_cache (bool) – Allow cache usage across iterations

Return type:

List[DNSQueryResult]

Returns:

List of DNSQueryResult objects

clear_cache()[source]

Clear the query cache.

Return type:

None

get_cache_stats()[source]

Get cache statistics.

Return type:

Dict[str, int]

get_failed_resolvers()[source]

Get resolvers with failure counts.

Return type:

Dict[str, int]

class net_benchmark.dns_benchmark.core.ResolverManager[source]

Bases: object

Manage DNS resolver configurations with comprehensive database.

RESOLVERS_DATABASE = [{'category': 'privacy', 'country': 'Global', 'description': 'Fast privacy-focused DNS with malware protection', 'doh_url': 'https://cloudflare-dns.com/dns-query', 'features': ['DNSSEC', 'Filtering', 'Anycast', 'DoH', 'DoT'], 'ip': '1.1.1.1', 'ipv6': '2606:4700:4700::1111', 'name': 'Cloudflare', 'provider': 'Cloudflare', 'type': 'public'}, {'category': 'family', 'country': 'Global', 'description': 'Family-friendly DNS with malware and adult content blocking', 'doh_url': 'https://family.cloudflare-dns.com/dns-query', 'features': ['Malware Blocking', 'Adult Content Blocking', 'DNSSEC'], 'ip': '1.1.1.3', 'ipv6': '2606:4700:4700::1113', 'name': 'Cloudflare Family', 'provider': 'Cloudflare', 'type': 'public'}, {'category': 'performance', 'country': 'Global', 'description': "Google's public DNS with global anycast network", 'doh_url': 'https://dns.google/dns-query', 'features': ['Anycast', 'Global Infrastructure', 'DoH'], 'ip': '8.8.8.8', 'ipv6': '2001:4860:4860::8888', 'name': 'Google', 'provider': 'Google', 'type': 'public'}, {'category': 'security', 'country': 'Global', 'description': 'Security-focused DNS with threat intelligence', 'doh_url': 'https://dns.quad9.net/dns-query', 'features': ['Malware Blocking', 'Phishing Protection', 'DNSSEC'], 'ip': '9.9.9.9', 'ipv6': '2620:fe::fe', 'name': 'Quad9', 'provider': 'Quad9', 'type': 'public'}, {'category': 'security', 'country': 'Global', 'description': "Cisco's secure DNS with content filtering", 'doh_url': 'https://doh.opendns.com/dns-query', 'features': ['Content Filtering', 'Phishing Protection', 'Customizable'], 'ip': '208.67.222.222', 'ipv6': '2620:119:35::35', 'name': 'OpenDNS', 'provider': 'Cisco', 'type': 'public'}, {'category': 'family', 'country': 'Global', 'description': 'FamilyShield with pre-configured adult content blocking', 'doh_url': 'https://doh.familyshield.opendns.com/dns-query', 'features': ['Adult Content Blocking', 'Malware Protection'], 'ip': '208.67.222.123', 'ipv6': '2620:119:35::123', 'name': 'OpenDNS Family', 'provider': 'Cisco', 'type': 'public'}, {'category': 'privacy', 'country': 'Cyprus', 'description': 'Privacy-focused DNS with ad and tracker blocking', 'doh_url': 'https://dns.adguard.com/dns-query', 'features': ['Ad Blocking', 'Tracker Blocking', 'Malware Protection'], 'ip': '94.140.14.14', 'ipv6': '2a10:50c0::ad1:ff', 'name': 'AdGuard', 'provider': 'AdGuard', 'type': 'public'}, {'category': 'family', 'country': 'Cyprus', 'description': 'Family protection with ad blocking and safe search', 'doh_url': 'https://dns-family.adguard.com/dns-query', 'features': ['Ad Blocking', 'Adult Content Blocking', 'Safe Search'], 'ip': '94.140.14.15', 'ipv6': '2a10:50c0::ad2:ff', 'name': 'AdGuard Family', 'provider': 'AdGuard', 'type': 'public'}, {'category': 'family', 'country': 'USA', 'description': 'Content filtering DNS for families', 'doh_url': 'https://doh.cleanbrowsing.org/doh/family-filter/', 'features': ['Adult Content Blocking', 'Safe Search', 'Malware Protection'], 'ip': '185.228.168.9', 'ipv6': '2a0d:2a00:1::', 'name': 'CleanBrowsing', 'provider': 'CleanBrowsing', 'type': 'public'}, {'category': 'regional', 'country': 'Russia', 'description': 'Yandex DNS optimized for Russian and CIS regions', 'doh_url': 'https://dns.yandex.net/dns-query', 'features': ['Regional Optimization', 'Safe Search'], 'ip': '77.88.8.8', 'ipv6': '2a02:6b8::feed:0ff', 'name': 'Yandex', 'provider': 'Yandex', 'type': 'public'}, {'category': 'security', 'country': 'USA', 'description': "Neustar's security-focused recursive DNS", 'doh_url': 'https://dns.neustar/dns-query', 'features': ['Malware Protection', 'Phishing Protection', 'Performance'], 'ip': '156.154.70.1', 'ipv6': '2610:a1:1018::1', 'name': 'Neustar', 'provider': 'Neustar', 'type': 'public'}, {'category': 'security', 'country': 'UK', 'description': 'SafeDNS with content filtering capabilities', 'doh_url': 'https://doh.safedns.com/dns-query', 'features': ['Content Filtering', 'Malware Protection'], 'ip': '195.46.39.39', 'ipv6': '', 'name': 'SafeDNS', 'provider': 'SafeDNS', 'type': 'public'}, {'category': 'customizable', 'country': 'Canada', 'description': 'Customizable DNS with extensive filtering options', 'doh_url': 'https://freedns.controld.com/p0', 'features': ['Custom Filtering', 'Analytics', 'DoH'], 'ip': '76.76.2.0', 'ipv6': '2606:1a40::', 'name': 'ControlD', 'provider': 'ControlD', 'type': 'public'}, {'category': 'privacy', 'country': 'USA', 'description': 'Alternative DNS focused on privacy and ad blocking', 'doh_url': 'https://dns.alternate-dns.com/dns-query', 'features': ['Ad Blocking', 'Tracker Blocking'], 'ip': '76.76.19.19', 'ipv6': '', 'name': 'Alternate DNS', 'provider': 'Alternate', 'type': 'public'}, {'category': 'regional', 'country': 'Czech Republic', 'description': "Czech NIC's public DNS service", 'doh_url': 'https://odvr.nic.cz/doh', 'features': ['DNSSEC', 'Local Optimization'], 'ip': '193.17.47.1', 'ipv6': '2001:148f:ffff::1', 'name': 'CZ.NIC', 'provider': 'CZ.NIC', 'type': 'public'}, {'category': 'privacy', 'country': 'Sweden', 'description': "VPN provider's public DNS with strong privacy and optional ad-blocking", 'doh_url': 'https://dns.mullvad.net/dns-query', 'features': ['No Logging', 'DNSSEC', 'Ad/Tracker Blocking (optional)', 'DoH'], 'ip': '194.242.2.2', 'ipv6': '2a07:e340::2', 'name': 'Mullvad', 'provider': 'Mullvad', 'type': 'public'}, {'category': 'privacy', 'country': 'France', 'description': "French association's privacy-respecting DNS, no filtering", 'doh_url': 'https://doh.libredns.gr/dns-query', 'features': ['No Logging', 'DNSSEC', 'Open Source', 'DoH'], 'ip': '116.202.176.26', 'ipv6': '2a01:4f8:1c1c:6c12::1', 'name': 'LibreDNS', 'provider': 'LibreDNS (FDN)', 'type': 'public'}, {'category': 'privacy', 'country': 'Italy/EU', 'description': 'European privacy-first DNS with malware protection', 'doh_url': 'https://dns0.eu/dns-query', 'features': ['GDPR-compliant', 'No Logging', 'Malware Blocking', 'DoH'], 'ip': '193.110.81.0', 'ipv6': '2a0f:fc80::', 'name': 'dns0.eu', 'provider': 'dns0.eu', 'type': 'public'}, {'category': 'privacy', 'country': 'Canada', 'description': "Canadian Internet Registry's private DNS with threat protection", 'doh_url': 'https://private.canadianshield.cira.ca/dns-query', 'features': ['Privacy Focused', 'Malware Blocking', 'DNSSEC', 'DoH'], 'ip': '149.112.121.10', 'ipv6': '2620:10a:80aa::10', 'name': 'CIRA Canadian Shield', 'provider': 'CIRA', 'type': 'public'}, {'category': 'performance', 'country': 'China', 'description': "Tencent's public DNS with strong domestic performance.", 'doh_url': 'https://doh.pub/dns-query', 'features': ['Anycast', 'DNSSEC', 'DDoS Protection', 'DoH'], 'ip': '119.29.29.29', 'ipv6': '2402:4e00::', 'name': 'DNSPod', 'provider': 'Tencent', 'type': 'public'}, {'category': 'performance', 'country': 'China', 'description': "Alibaba's public DNS integrated with global CDN.", 'doh_url': 'https://dns.alidns.com/dns-query', 'features': ['Anycast', 'DNSSEC', 'Global Infrastructure', 'DoH'], 'ip': '223.5.5.5', 'ipv6': '2400:3200::1', 'name': 'AliDNS', 'provider': 'Alibaba', 'type': 'public'}, {'category': 'security', 'country': 'Russia', 'description': "Russian cybersecurity company's public DNS with threat protection.", 'doh_url': 'https://dns.comss.one/dns-query', 'features': ['Malware Blocking', 'Phishing Protection', 'DoH'], 'ip': '77.75.236.66', 'ipv6': '', 'name': 'Comss DNS', 'provider': 'Comss.one', 'type': 'public'}]
static parse_resolver_string(resolver_string)[source]

Parse comma-separated resolver IPs/names into resolver list.

Supports: - IP addresses: “1.1.1.1,8.8.8.8” - IPv6 addresses: “2606:4700:4700::1111,2001:4860:4860::8888” - Named resolvers from database: “Cloudflare,Google” - Mixed: “1.1.1.1,Cloudflare”

Parameters:

resolver_string (str) – Comma-separated resolver identifiers

Return type:

List[Dict[str, str]]

Returns:

List of resolver dictionaries with ‘name’ and ‘ip’ keys

static parse_resolvers_input(input_value)[source]

Smart parser that handles both file paths and comma-separated inline values.

Detection logic: 1. If input contains comma and no file extension -> treat as comma-separated 2. If file exists at path -> load from file 3. If input looks like single IP -> treat as single resolver 4. Otherwise -> try as file path (will raise FileNotFoundError if not found)

Parameters:

input_value (Optional[str]) – File path or comma-separated resolver string

Return type:

List[Dict[str, str]]

Returns:

List of resolver dictionaries

Raises:
static get_default_resolvers()[source]

Get a list of commonly used public resolvers.

Return type:

List[Dict[str, str]]

static load_resolvers_from_file(file_path)[source]

Load resolvers from JSON file.

Return type:

List[Dict[str, str]]

static get_all_resolvers()[source]

Get all available resolvers with detailed information.

Return type:

List[Dict[str, Any]]

static get_resolvers_by_category(category)[source]

Get resolvers filtered by category.

Return type:

List[Dict[str, Any]]

static get_categories()[source]

Get all available resolver categories.

Return type:

List[str]

class net_benchmark.dns_benchmark.core.DomainManager[source]

Bases: object

Manage domain lists with comprehensive database.

DOMAINS_DATABASE: List[Dict[str, Any]] = [{'category': 'search', 'country': 'USA', 'description': "World's most popular search engine", 'dnssec_signed': False, 'domain': 'google.com'}, {'category': 'video', 'country': 'USA', 'description': 'Video sharing platform', 'dnssec_signed': False, 'domain': 'youtube.com'}, {'category': 'social', 'country': 'USA', 'description': 'Social networking service', 'dnssec_signed': False, 'domain': 'facebook.com'}, {'category': 'ecommerce', 'country': 'USA', 'description': 'E-commerce and cloud computing', 'dnssec_signed': False, 'domain': 'amazon.com'}, {'category': 'social', 'country': 'USA', 'description': 'Social media and microblogging', 'dnssec_signed': False, 'domain': 'twitter.com'}, {'category': 'social', 'country': 'USA', 'description': 'Photo and video sharing platform', 'dnssec_signed': False, 'domain': 'instagram.com'}, {'category': 'professional', 'country': 'USA', 'description': 'Professional networking', 'dnssec_signed': False, 'domain': 'linkedin.com'}, {'category': 'reference', 'country': 'USA', 'description': 'Free online encyclopedia', 'dnssec_signed': False, 'domain': 'wikipedia.org'}, {'category': 'tech', 'country': 'USA', 'description': 'Software and technology company', 'dnssec_signed': False, 'domain': 'microsoft.com'}, {'category': 'tech', 'country': 'USA', 'description': 'Consumer electronics and software', 'dnssec_signed': False, 'domain': 'apple.com'}, {'category': 'streaming', 'country': 'USA', 'description': 'Video streaming service', 'dnssec_signed': False, 'domain': 'netflix.com'}, {'category': 'tech', 'country': 'USA', 'description': 'Code hosting and collaboration', 'dnssec_signed': False, 'domain': 'github.com'}, {'category': 'tech', 'country': 'USA', 'description': 'Programming Q&A community', 'dnssec_signed': False, 'domain': 'stackoverflow.com'}, {'category': 'social', 'country': 'USA', 'description': 'Social news aggregation', 'dnssec_signed': False, 'domain': 'reddit.com'}, {'category': 'messaging', 'country': 'USA', 'description': 'Instant messaging platform', 'dnssec_signed': False, 'domain': 'whatsapp.com'}, {'category': 'infrastructure', 'country': 'USA', 'description': 'CDN and security services', 'dnssec_signed': True, 'domain': 'cloudflare.com'}, {'category': 'infrastructure', 'country': 'USA', 'description': 'Internet Systems Consortium (BIND, DHCP)', 'dnssec_signed': True, 'domain': 'isc.org'}, {'category': 'dns', 'country': 'Netherlands', 'description': 'NLnet Labs (NSD, Unbound, ldns)', 'dnssec_signed': True, 'domain': 'nlnetlabs.nl'}, {'category': 'security', 'country': 'USA', 'description': 'DNSSEC tools and test suite', 'dnssec_signed': True, 'domain': 'dnssec-tools.org'}, {'category': 'standards', 'country': 'USA', 'description': 'Internet Engineering Task Force', 'dnssec_signed': True, 'domain': 'ietf.org'}, {'category': 'search', 'country': 'China', 'description': 'Chinese search engine', 'dnssec_signed': False, 'domain': 'baidu.com'}, {'category': 'ecommerce', 'country': 'China', 'description': 'Chinese online shopping', 'dnssec_signed': False, 'domain': 'taobao.com'}, {'category': 'portal', 'country': 'China', 'description': 'Chinese web portal', 'dnssec_signed': False, 'domain': 'qq.com'}, {'category': 'ecommerce', 'country': 'China', 'description': 'Chinese B2C online retail', 'dnssec_signed': False, 'domain': 'tmall.com'}, {'category': 'portal', 'country': 'USA', 'description': 'Web services portal', 'dnssec_signed': False, 'domain': 'yahoo.com'}, {'category': 'search', 'country': 'USA', 'description': "Microsoft's search engine", 'dnssec_signed': False, 'domain': 'bing.com'}, {'category': 'email', 'country': 'USA', 'description': 'Microsoft email and services', 'dnssec_signed': False, 'domain': 'live.com'}, {'category': 'productivity', 'country': 'USA', 'description': 'Microsoft Office suite', 'dnssec_signed': False, 'domain': 'office.com'}, {'category': 'communication', 'country': 'USA', 'description': 'Video conferencing platform', 'dnssec_signed': False, 'domain': 'zoom.us'}, {'category': 'communication', 'country': 'USA', 'description': 'Business communication platform', 'dnssec_signed': False, 'domain': 'slack.com'}, {'category': 'storage', 'country': 'USA', 'description': 'Cloud storage service', 'dnssec_signed': False, 'domain': 'dropbox.com'}, {'category': 'creative', 'country': 'USA', 'description': 'Creative software suite', 'dnssec_signed': False, 'domain': 'adobe.com'}, {'category': 'finance', 'country': 'USA', 'description': 'Online payments system', 'dnssec_signed': False, 'domain': 'paypal.com'}, {'category': 'publishing', 'country': 'USA', 'description': 'Blogging and website platform', 'dnssec_signed': False, 'domain': 'wordpress.com'}, {'category': 'publishing', 'country': 'USA', 'description': 'Online publishing platform', 'dnssec_signed': False, 'domain': 'medium.com'}, {'category': 'qna', 'country': 'USA', 'description': 'Question and answer platform', 'dnssec_signed': False, 'domain': 'quora.com'}, {'category': 'entertainment', 'country': 'USA', 'description': 'Movie and TV database', 'dnssec_signed': False, 'domain': 'imdb.com'}, {'category': 'news', 'country': 'UK', 'description': 'British broadcasting news', 'dnssec_signed': False, 'domain': 'bbc.com'}, {'category': 'news', 'country': 'USA', 'description': 'Cable news network', 'dnssec_signed': False, 'domain': 'cnn.com'}, {'category': 'news', 'country': 'USA', 'description': 'New York Times newspaper', 'dnssec_signed': False, 'domain': 'nytimes.com'}, {'category': 'weather', 'country': 'USA', 'description': 'Weather forecasting service', 'dnssec_signed': False, 'domain': 'weather.com'}, {'category': 'sports', 'country': 'USA', 'description': 'Sports news and coverage', 'dnssec_signed': False, 'domain': 'espn.com'}, {'category': 'classifieds', 'country': 'USA', 'description': 'Classified advertisements', 'dnssec_signed': False, 'domain': 'craigslist.org'}, {'category': 'ecommerce', 'country': 'USA', 'description': 'Online auction and shopping', 'dnssec_signed': False, 'domain': 'ebay.com'}, {'category': 'ecommerce', 'country': 'China', 'description': 'Chinese online retail', 'dnssec_signed': False, 'domain': 'aliexpress.com'}, {'category': 'ecommerce', 'country': 'USA', 'description': 'Multinational retail corporation', 'dnssec_signed': False, 'domain': 'walmart.com'}, {'category': 'ecommerce', 'country': 'USA', 'description': 'Retail corporation', 'dnssec_signed': False, 'domain': 'target.com'}, {'category': 'ecommerce', 'country': 'USA', 'description': 'Consumer electronics retailer', 'dnssec_signed': False, 'domain': 'bestbuy.com'}, {'category': 'streaming', 'country': 'USA', 'description': 'Video streaming service', 'dnssec_signed': False, 'domain': 'hulu.com'}, {'category': 'music', 'country': 'Sweden', 'description': 'Music streaming platform', 'dnssec_signed': False, 'domain': 'spotify.com'}, {'category': 'music', 'country': 'Germany', 'description': 'Audio distribution platform', 'dnssec_signed': False, 'domain': 'soundcloud.com'}, {'category': 'music', 'country': 'France', 'description': 'Music streaming service', 'dnssec_signed': False, 'domain': 'deezer.com'}, {'category': 'gaming', 'country': 'USA', 'description': 'Live streaming for gamers', 'dnssec_signed': False, 'domain': 'twitch.tv'}, {'category': 'gaming', 'country': 'USA', 'description': 'Digital game distribution', 'dnssec_signed': False, 'domain': 'steampowered.com'}, {'category': 'gaming', 'country': 'USA', 'description': 'Video game and software developer', 'dnssec_signed': False, 'domain': 'epicgames.com'}, {'category': 'tech', 'country': 'UK', 'description': 'Linux distribution', 'dnssec_signed': False, 'domain': 'ubuntu.com'}, {'category': 'tech', 'country': 'USA', 'description': 'Container platform', 'dnssec_signed': False, 'domain': 'docker.com'}, {'category': 'tech', 'country': 'USA', 'description': 'Container orchestration', 'dnssec_signed': False, 'domain': 'kubernetes.io'}, {'category': 'tech', 'country': 'USA', 'description': 'DevOps platform', 'dnssec_signed': False, 'domain': 'gitlab.com'}, {'category': 'tech', 'country': 'Australia', 'description': 'Software development tools', 'dnssec_signed': False, 'domain': 'atlassian.com'}, {'category': 'productivity', 'country': 'USA', 'description': 'Note-taking and collaboration', 'dnssec_signed': False, 'domain': 'notion.so'}, {'category': 'design', 'country': 'USA', 'description': 'Collaborative design tool', 'dnssec_signed': False, 'domain': 'figma.com'}, {'category': 'design', 'country': 'Australia', 'description': 'Graphic design platform', 'dnssec_signed': False, 'domain': 'canva.com'}]
static parse_domain_string(domain_string)[source]

Parse comma-separated domain names into domain list.

Supports: - Domain names: “google.com,github.com,example.com” - Domains with whitespace: “google.com, github.com, example.com” - Mixed case: “Google.com,GitHub.com”

Parameters:

domain_string (str) – Comma-separated domain names

Return type:

List[str]

Returns:

List of domain strings (lowercased and cleaned)

static parse_domains_input(input_value)[source]

Smart parser that handles both file paths and comma-separated inline values.

Detection logic: 1. If input contains comma -> treat as comma-separated 2. If file exists at path -> load from file 3. If input looks like single domain -> treat as single domain 4. Otherwise -> try as file path (will raise FileNotFoundError if not found)

Parameters:

input_value (Optional[str]) – File path or comma-separated domain string

Return type:

List[str]

Returns:

List of domain strings

Raises:

FileNotFoundError – If file path is invalid

static get_sample_domains()[source]

Get a list of sample domains for testing.

Return type:

List[str]

static load_domains_from_file(file_path)[source]

Load domains from text file (one per line).

Return type:

List[str]

static get_all_domains()[source]

Get all available domains with detailed information.

Return type:

List[Dict[str, Any]]

static get_domains_by_category(category)[source]

Get domains filtered by category.

Return type:

List[Dict[str, Any]]

static get_categories()[source]

Get all available domain categories.

Return type:

List[str]