# Zone Update
[](https://crates.io/crates/zone-update)
[](https://docs.rs/zone-update)
[](https://github.com/tarka/zone-update/actions)
[](https://github.com/tarka/zone-update/blob/main/README.md#License)
A minimal Rust library providing CRUD-like operations on DNS records with various DNS providers.
## Overview
Zone Update is a lightweight library that provides a simple interface for
programmatically managing DNS zone records through provider APIs.
The library is both blocking and async, and supports both `smol` and `tokio`.
### Supported DNS providers
Currently, Zone Update supports the following DNS providers:
* Cloudflare
* Dnsimple
* DnsMadeEasy
* Gandi
* Porkbun
See the [DNS providers matrix](docs/PROVIDERS.md) for more details.
## Installation
Add this to your `Cargo.toml`:
```toml
[dependencies]
zone-update = "0.1.0"
```
## Usage
### Basic Example
```rust
use zone_update::{gandi, DnsProvider, errors::Result};
use std::net::Ipv4Addr;
fn update_gandi_record() -> Result<()> {
let config = zone_update::Config {
domain: "example.com".to_string(),
dry_run: false,
};
let auth = gandi::Auth::ApiKey("your-api-key".to_string());
let client = gandi::Gandi::new(config, auth);
let host = "www";
let new_ip = Ipv4Addr::new(192, 0, 2, 1);
// Update the A record for www.example.com
client.update_a_record(host, &new_ip)?;
Ok(())
}
```
See the `examples` directory for other use-cases.
## Contributing
At this point the most useful contributions would be to add additional DNS
provider APIs. However other contributions are welcome.
### AI Contribution Policy
LLM and related 'AI' technologies can be useful for software development, but
best-practices on their usage are still evolving. For this reason this project
will not accept runtime code generated by AI. Generation of _draft_
documentation and test code is acceptable, but should be reviewed by the
submitter before raising a PR.
## License
This project is licensed under either of:
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE-2.0.txt))
- MIT license ([LICENSE-MIT](LICENSE-MIT))
at your option.