Skip to main content

ZoneHandler

Trait ZoneHandler 

Source
pub trait ZoneHandler: Send + Sync {
Show 13 methods // Required methods fn zone_type(&self) -> ZoneType; fn axfr_policy(&self) -> AxfrPolicy; fn origin(&self) -> &LowerName; fn lookup<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, name: &'life1 LowerName, rtype: RecordType, request_info: Option<&'life2 RequestInfo<'life3>>, lookup_options: LookupOptions, ) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn search<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 Request, lookup_options: LookupOptions, ) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn nsec_records<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 LowerName, lookup_options: LookupOptions, ) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn nsec3_records<'life0, 'life1, 'async_trait>( &'life0 self, info: Nsec3QueryInfo<'life1>, lookup_options: LookupOptions, ) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn nx_proof_kind(&self) -> Option<&NxProofKind>; fn metrics_label(&self) -> &'static str; // Provided methods fn can_validate_dnssec(&self) -> bool { ... } fn update<'life0, 'life1, 'async_trait>( &'life0 self, _update: &'life1 Request, _now: u64, ) -> Pin<Box<dyn Future<Output = (Result<bool, ResponseCode>, Option<TSigResponseContext>)> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn consult<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _name: &'life1 LowerName, _rtype: RecordType, _request_info: Option<&'life2 RequestInfo<'life3>>, _lookup_options: LookupOptions, last_result: LookupControlFlow<AuthLookup>, ) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait { ... } fn zone_transfer<'life0, 'life1, 'async_trait>( &'life0 self, _request: &'life1 Request, _lookup_options: LookupOptions, _now: u64, ) -> Pin<Box<dyn Future<Output = Option<(Result<ZoneTransfer, LookupError>, Option<TSigResponseContext>)>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... }
}
Expand description

ZoneHandler implementations can be used with a Catalog

Required Methods§

Source

fn zone_type(&self) -> ZoneType

What type is this zone

Source

fn axfr_policy(&self) -> AxfrPolicy

Return the policy for determining if AXFR requests are allowed

Source

fn origin(&self) -> &LowerName

Get the origin of this zone, i.e. example.com is the origin for www.example.com

Source

fn lookup<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, name: &'life1 LowerName, rtype: RecordType, request_info: Option<&'life2 RequestInfo<'life3>>, lookup_options: LookupOptions, ) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Looks up all Resource Records matching the given Name and RecordType.

§Arguments
  • name - The name to look up.
  • rtype - The RecordType to look up. RecordType::ANY will return all records matching name. RecordType::AXFR will return all record types except RecordType::SOA due to the requirements that on zone transfers the RecordType::SOA must both precede and follow all other records.
  • request_info - The RequestInfo structure for the request, if it is available.
  • lookup_options - Query-related lookup options (e.g., DNSSEC DO bit, supported hash algorithms, etc.)
§Return value

A LookupControlFlow containing the lookup that should be returned to the client.

Source

fn search<'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 Request, lookup_options: LookupOptions, ) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Using the specified query, perform a lookup against this zone.

§Arguments
  • request - the query to perform the lookup with.
  • lookup_options - Query-related lookup options (e.g., DNSSEC DO bit, supported hash algorithms, etc.)
§Return value

A LookupControlFlow containing the lookup that should be returned to the client.

An optional ResponseSigner to use to sign the response returned to the client.

Source

fn nsec_records<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 LowerName, lookup_options: LookupOptions, ) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return the NSEC records based on the given name

§Arguments
  • name - given this name (i.e. the lookup name), return the NSEC record that is less than this
  • lookup_options - Query-related lookup options (e.g., DNSSEC DO bit, supported hash algorithms, etc.)
Source

fn nsec3_records<'life0, 'life1, 'async_trait>( &'life0 self, info: Nsec3QueryInfo<'life1>, lookup_options: LookupOptions, ) -> Pin<Box<dyn Future<Output = LookupControlFlow<AuthLookup>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Available on crate feature __dnssec only.

Return the NSEC3 records based on the information available for a query.

Source

fn nx_proof_kind(&self) -> Option<&NxProofKind>

Available on crate feature __dnssec only.

Returns the kind of non-existence proof used for this zone.

Source

fn metrics_label(&self) -> &'static str

Available on crate feature metrics only.

Returns the zone handler metrics label.

Provided Methods§

Source

fn can_validate_dnssec(&self) -> bool

Whether the zone handler can perform DNSSEC validation

Source

fn update<'life0, 'life1, 'async_trait>( &'life0 self, _update: &'life1 Request, _now: u64, ) -> Pin<Box<dyn Future<Output = (Result<bool, ResponseCode>, Option<TSigResponseContext>)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Perform a dynamic update of a zone

Source

fn consult<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _name: &'life1 LowerName, _rtype: RecordType, _request_info: Option<&'life2 RequestInfo<'life3>>, _lookup_options: LookupOptions, last_result: LookupControlFlow<AuthLookup>, ) -> Pin<Box<dyn Future<Output = (LookupControlFlow<AuthLookup>, Option<TSigResponseContext>)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Consulting lookup for all Resource Records matching the given Name and RecordType. This will be called in a chained zone handler configuration after a zone handler in the chain has returned a lookup with a LookupControlFlow::Continue action. Every other zone handler in the chain will be called via this consult method, until one either returns a LookupControlFlow::Break action, or all zone handlers have been consulted. The zone handler that generated the primary lookup (the one returned via ‘lookup’) will not be consulted.

§Arguments
  • name - The name to look up.
  • rtype - The RecordType to look up. RecordType::ANY will return all records matching name. RecordType::AXFR will return all record types except RecordType::SOA due to the requirements that on zone transfers the RecordType::SOA must both precede and follow all other records.
  • request_info - The RequestInfo structure for the request, if it is available.
  • lookup_options - Query-related lookup options (e.g., DNSSEC DO bit, supported hash algorithms, etc.)
  • last_result - The lookup returned by a previous zone handler in a chained configuration. If a subsequent zone handler does not modify this lookup, it will be returned to the client after consulting all zone handlers in the chain.
§Return value

A LookupControlFlow containing the lookup that should be returned to the client. This can be the same last_result that was passed in, or a new lookup, depending on the logic of the zone handler in question.

An optional ResponseSigner to use to sign the response returned to the client. If it is None and an earlier zone handler provided Some, it will be ignored. If it is Some it will be used to replace any previous ResponseSigner.

Source

fn zone_transfer<'life0, 'life1, 'async_trait>( &'life0 self, _request: &'life1 Request, _lookup_options: LookupOptions, _now: u64, ) -> Pin<Box<dyn Future<Output = Option<(Result<ZoneTransfer, LookupError>, Option<TSigResponseContext>)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns all records in the zone.

This will return None if the next zone handler in the zone handler chain should be used instead.

Implementors§

Source§

impl ZoneHandler for BlocklistZoneHandler

Available on crate feature blocklist only.
Source§

impl ZoneHandler for FileZoneHandler

Source§

impl<P: RuntimeProvider + Send + Sync> ZoneHandler for InMemoryZoneHandler<P>

Source§

impl<P: RuntimeProvider + Send + Sync> ZoneHandler for SqliteZoneHandler<P>

Available on crate feature sqlite only.
Source§

impl<P: RuntimeProvider> ZoneHandler for RecursiveZoneHandler<P>

Available on crate feature recursor only.
Source§

impl<P: ConnectionProvider> ZoneHandler for ForwardZoneHandler<P>

Available on crate feature resolver only.