Module ddns

Module ddns 

Source
Expand description

Dynamic DNS update utilities for BIND9 via RFC 2136.

This module provides functionality for updating DNS records in BIND9 using:

  • Direct DNS updates via hickory-client (TCP port 53, RFC 2136)
  • Zone operations via bindcar HTTP API

It includes:

  • Hash calculation for change detection
  • Direct DNS update functions using hickory-client
  • Zone transfer triggering via bindcar API

§Architecture

Record reconcilers use this module to:

  1. Calculate hash of current record data
  2. Compare with last known hash in status.record_hash
  3. If hash changed, send RFC 2136 update to BIND9 via hickory-client
  4. Update sent directly to primary BIND9 instance (TCP port 53)
  5. BIND9 handles zone transfer to secondaries automatically

§Example

use bindy::ddns::calculate_record_hash;
use bindy::crd::ARecordSpec;

let spec = ARecordSpec {
    name: "www".to_string(),
    ipv4_addresses: vec!["192.0.2.1".to_string()],
    ttl: Some(300),
};

// Calculate current hash
let current_hash = calculate_record_hash(&spec);
// hash is a 64-character hex string
assert_eq!(current_hash.len(), 64);

Functions§

calculate_record_hash
Calculate SHA-256 hash of a record’s data fields.