pub struct RndcExecutor { /* private fields */ }Expand description
RNDC command executor using native protocol
Implementations§
Source§impl RndcExecutor
impl RndcExecutor
Sourcepub fn new(server: String, algorithm: String, secret: String) -> Result<Self>
pub fn new(server: String, algorithm: String, secret: String) -> Result<Self>
Create a new RNDC executor
§Arguments
server- RNDC server address (e.g., “127.0.0.1:953”)algorithm- HMAC algorithm, accepts both formats:- With prefix: “hmac-md5”, “hmac-sha1”, “hmac-sha224”, “hmac-sha256”, “hmac-sha384”, “hmac-sha512”
- Without prefix: “md5”, “sha1”, “sha224”, “sha256”, “sha384”, “sha512”
secret- Base64-encoded RNDC secret key
§Returns
A new RndcExecutor instance
Sourcepub async fn addzone(
&self,
zone_name: &str,
zone_config: &str,
) -> Result<String>
pub async fn addzone( &self, zone_name: &str, zone_config: &str, ) -> Result<String>
Add a zone
§Arguments
zone_name- Name of the zone (e.g., “example.com”)zone_config- Zone configuration block (e.g., “{ type primary; file "/var/cache/bind/example.com.zone"; }”)
Sourcepub async fn zonestatus(&self, zone_name: &str) -> Result<String>
pub async fn zonestatus(&self, zone_name: &str) -> Result<String>
Get zone status
Sourcepub async fn freeze(&self, zone_name: &str) -> Result<String>
pub async fn freeze(&self, zone_name: &str) -> Result<String>
Freeze a zone (disable dynamic updates)
Sourcepub async fn thaw(&self, zone_name: &str) -> Result<String>
pub async fn thaw(&self, zone_name: &str) -> Result<String>
Thaw a zone (enable dynamic updates)
Sourcepub async fn notify(&self, zone_name: &str) -> Result<String>
pub async fn notify(&self, zone_name: &str) -> Result<String>
Notify secondaries about zone changes
Sourcepub async fn retransfer(&self, zone_name: &str) -> Result<String>
pub async fn retransfer(&self, zone_name: &str) -> Result<String>
Force a zone retransfer from primary
This command is used on secondary zones to discard the current zone data and initiate a fresh transfer from the primary server.
Sourcepub async fn modzone(
&self,
zone_name: &str,
zone_config: &str,
) -> Result<String>
pub async fn modzone( &self, zone_name: &str, zone_config: &str, ) -> Result<String>
Modify a zone configuration
§Arguments
zone_name- Name of the zone (e.g., “example.com”)zone_config- Zone configuration block (e.g., “{ also-notify { 10.0.0.1; }; allow-transfer { 10.0.0.2; }; }”)
Sourcepub async fn reconfig(&self) -> Result<String>
pub async fn reconfig(&self) -> Result<String>
Reload the server configuration (rndc reconfig).
Loads new or changed configuration without re-transferring or
bouncing unaffected zones. Required after Self::modzone stores a
dnssec-policy: verified on BIND 9.18.50 (ADR-0001), modzone
persists the policy to the NZD without applying it to the running
zone — only a reconfig (or full reload) activates it.
§Errors
Returns an error if the RNDC command fails.
Sourcepub async fn dnssec_status(&self, zone_name: &str) -> Result<String>
pub async fn dnssec_status(&self, zone_name: &str) -> Result<String>
Get a zone’s DNSSEC signing state (rndc dnssec -status <zone>).
The raw output is parsed with crate::dnssec::parse_dnssec_status.
A zone without a policy returns the literal text
Zone does not have dnssec-policy rather than an error.
§Arguments
zone_name- Name of the zone (e.g., “example.com”)
§Errors
Returns an error for an invalid zone name or a failed RNDC command.
Sourcepub async fn dnssec_checkds(
&self,
zone_name: &str,
key_tag: u16,
state: CheckdsState,
) -> Result<String>
pub async fn dnssec_checkds( &self, zone_name: &str, key_tag: u16, state: CheckdsState, ) -> Result<String>
Report a DS state change at the parent zone to named
(rndc dnssec -checkds -key <tag> <published|withdrawn> <zone>).
Used when no parental agents are configured: named will not advance
a key’s DS-dependent state transitions (including the graceful
unsigning managed by the built-in insecure policy) until it is told
the DS was published or withdrawn at the parent.
§Arguments
zone_name- Name of the zone (e.g., “example.com”)key_tag- Key tag of the DNSKEY whose DS changed at the parentstate- Whether the DS is now published or withdrawn
§Errors
Returns an error for an invalid zone name or a failed RNDC command.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RndcExecutor
impl RefUnwindSafe for RndcExecutor
impl Send for RndcExecutor
impl Sync for RndcExecutor
impl Unpin for RndcExecutor
impl UnwindSafe for RndcExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].