pub struct FileAuthority(_);
Expand description

FileAuthority is responsible for storing the resource records for a particular zone.

Authorities default to DNSClass IN. The ZoneType specifies if this should be treated as the start of authority for the zone, is a Secondary, or a cached zone.

Implementations

Creates a new Authority.

Arguments
  • origin - The zone Name being created, this should match that of the RecordType::SOA record.
  • records - The map of the initial set of records in the zone.
  • zone_type - The type of zone, i.e. is this authoritative?
  • allow_update - If true, then this zone accepts dynamic updates.
  • is_dnssec_enabled - If true, then the zone will sign the zone with all registered keys, (see add_zone_signing_key())
Return value

The new Authority.

Read the Authority for the origin from the specified configuration

Unwrap the InMemoryAuthority

Methods from Deref<Target = InMemoryAuthority>

The DNSClass of this zone

This is supported on crate feature testing only.

Allow AXFR’s (zone transfers)

Clears all records (including SOA, etc)

Retrieve the Signer, which contains the private keys, for this zone

Get all the records

Get a mutable reference to the records

Get a mutable reference to the records

Returns the minimum ttl (as used in the SOA record)

get the current serial number for the zone.

Inserts or updates a Record depending on it’s existence in the authority.

Guarantees that SOA, CNAME only has one record, will implicitly update if they already exist.

Arguments
  • record - The Record to be inserted or updated.
  • serial - Current serial number to be recorded against updates.
Return value

true if the value was inserted, false otherwise

Non-async version of upsert when behind a mutable reference.

This is supported on crate feature dnssec only.

Non-async method of add_update_auth_key when behind a mutable reference

This is supported on crate feature dnssec only.

Non-async method of add_zone_signing_key when behind a mutable reference

This is supported on crate feature dnssec only.

(Re)generates the nsec records, increments the serial number and signs the zone

Trait Implementations

What type is this zone

Return true if AXFR is allowed

Perform a dynamic update of a zone

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

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

Arguments
  • name - The Name, label, to lookup.
  • rtype - The RecordType, to lookup. 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.
  • is_secure - If the DO bit is set on the EDNS OPT record, then return RRSIGs as well.
Return value

None if there are no matching records, otherwise a Vec containing the found records.

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

Arguments
  • query - the query to perform the lookup with.
  • is_secure - if true, then RRSIG records (if this is a secure zone) will be returned.
Return value

Returns a vectory containing the results of the query, it will be empty if not found. If is_secure is true, in the case of no records found then NSEC records will be returned.

Get the NS, NameServer, record for the zone

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
  • is_secure - if true then it will return RRSIG records as well

Returns the SOA of the authority.

Note: This will only return the SOA, if this is fulfilling a request, a standard lookup should be used, see soa_secure(), which will optionally return RRSIGs.

Returns the SOA record for the zone

Result of a lookup

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Add a (Sig0) key that is authorized to perform updates against this authority

Add Signer

Sign the zone for DNSSEC

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more