delete_dns_record

Function delete_dns_record 

Source
pub async fn delete_dns_record(
    zone_name: &str,
    name: &str,
    record_type: RecordType,
    server: &str,
    key_data: &RndcKeyData,
) -> Result<()>
Expand description

Delete a DNS record of any type using dynamic DNS update (RFC 2136).

This function sends an RFC 2136 DELETE operation to remove ALL records of the specified type for the given name.

§Arguments

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

§Returns

Returns Ok(()) if deletion succeeded (NoError) or the record already did not exist (NXDomain/NXRRSet — idempotent success).

§Errors

Returns an error if the connection fails or the DNS server rejects the update with any other response code (e.g. Refused, NotAuth, NotZone, ServFail), so TSIG/ACL failures are never silently swallowed.