nadzoring.network_base.domain_info module

Comprehensive domain information aggregation.

type nadzoring.network_base.domain_info._AddrInfo = Sequence[tuple[AddressFamily, SocketKind, int, str, tuple[Any, ...]]]
nadzoring.network_base.domain_info._get_dns_records(domain: str) → dict[str, list[str]][source]

Retrieve basic DNS records for a domain.

Attempts to resolve A, AAAA, MX, NS, and TXT records using the system resolver via socket and subprocess fallbacks where available.

Parameters:

domain – The domain to query.

Returns:

Dictionary mapping record type strings to lists of record values. Missing record types are omitted.

nadzoring.network_base.domain_info._resolve_domain(domain: str) → dict[str, str | None][source]

Resolve a domain to its IP addresses.

Parameters:

domain – The domain name to resolve.

Returns:

Dictionary with keys ipv4 (str or None) and ipv6 (str or None).

nadzoring.network_base.domain_info.get_domain_info(domain: str) → dict[str, Any][source]

Retrieve comprehensive information about a domain.

Aggregates WHOIS registration data, DNS records, IP geolocation, and reverse DNS for the resolved IP address into a single structured response.

Parameters:

domain – The domain name to investigate (e.g. "example.com").

Returns:

  • domain (str): The queried domain.

  • whois (dict): Parsed WHOIS fields; contains error key on failure.

  • dns (dict): Resolved IP addresses under ipv4/ipv6 and DNS record lists by type.

  • geolocation (dict): Geographic data for the resolved IP (lat, lon, country, city), or empty dict on failure.

  • reverse_dns (str | None): Reverse DNS hostname for the primary IPv4 address, or None if unavailable.

Return type:

Dictionary with the following top-level keys

Examples

>>> info = get_domain_info("example.com")
>>> info["whois"]["registrar"]
'RESERVED-Internet Assigned Numbers Authority'
>>> info["geolocation"]["country"]
'United States'