| Crates.io | zoneparser |
| lib.rs | zoneparser |
| version | 0.1.6 |
| created_at | 2024-09-06 06:21:39.187173+00 |
| updated_at | 2025-11-27 13:33:18.459778+00 |
| description | A fast zonefile parser |
| homepage | |
| repository | https://github.com/erikoest/zoneparser |
| max_upload_size | |
| id | 1365578 |
| size | 51,097 |
The ZoneParser is a DNS zonefile parser. It has been designed to have a good performance with regards to cpu and memory consumption. It works well with large zonefiles. The code is in an early stage of development and still has a somewhat limited functionality.
The parser is constructed with a file as input. It then works as an iterator yielding the resource records of the zone. An example:
use zoneparser::ZoneParser;
fn main() {
let file = File::open("my-zone.no").unwrap();
let p = ZoneParser::new(&file, "my-zone.no");
for next in p {
match next {
Err(e) => {
println!("Parse error: {}", e);
break;
},
Ok(rr) => {
println!("{}", rr);
},
}
}
}
For further examples, see the included command line tools zonecount
and zonediff.
The limited functionality very much reflects the needs I had when I wrote the library. If you find it useful, and miss some functionality, please let me know. It might motivate me to further development. Bug reports are always welcome.