query_dns_record

Function query_dns_record 

Source
pub async fn query_dns_record(
    zone_name: &str,
    name: &str,
    record_type: RecordType,
    server: &str,
) -> Result<Vec<Record>>
Expand description

Generic DNS record query function.

Queries a DNS server for records of a specific type and returns the results.

§Arguments

  • zone_name - The DNS zone name
  • name - The record name (e.g., “www” for www.example.com, or “@” for apex)
  • record_type - The DNS record type (A, AAAA, TXT, MX, etc.)
  • server - The DNS server address (IP:port)

§Returns

Returns Ok(vec) with matching records (empty if none exist), or an error if the query fails.

§Errors

Returns an error if the DNS query fails or cannot be parsed.