Expand description
§hornet-bind9
Parse, write, and validate BIND9 named.conf configuration files and DNS
zone files.
§Quick start
use hornet_bind9::parse_named_conf;
let input = r#"
options {
directory "/var/cache/bind";
recursion yes;
allow-query { any; };
};
zone "example.com" {
type primary;
file "/etc/bind/zones/example.com.db";
};
"#;
let conf = parse_named_conf(input).expect("parse failed");
assert_eq!(conf.statements.len(), 2);§Feature flags
| Flag | Default | Description |
|---|---|---|
serde | off | Derive serde::Serialize/Deserialize on all AST types |
Re-exports§
pub use ast::named_conf;pub use ast::zone_file;pub use error::Error;pub use error::Result;pub use error::Severity;pub use error::ValidationError;
Modules§
- ast
- error
- Error types for
hornet-bind9. - parser
- validator
- Semantic validation of parsed BIND9 configuration.
- writer
- Serialise the AST back to valid BIND9 configuration text.
Functions§
- parse_
named_ conf - Parse a
named.confstring into an AST. - parse_
named_ conf_ file - Parse a
named.conffile from disk. - parse_
zone_ file - Parse a DNS zone file string into an AST.
- parse_
zone_ file_ from_ path - Parse a zone file from disk.
- validate_
named_ conf - Validate a parsed
named.confAST and return any diagnostics. - validate_
zone_ file - Validate a parsed zone file AST and return any diagnostics.
- write_
named_ conf - Serialise a [
NamedConf] AST back to aString. - write_
zone_ file - Serialise a [
ZoneFile] AST back to aString.