A minimal Rust library for updating DNS records with various DNS providers.
Zone Update is a lightweight library that provides a simple interface for
programmatically managing DNS records through provider APIs.
The library is async and supports both smol and tokio.
Currently, Zone Update supports the following DNS providers:
- Cloudflare
- Dnsimple
- DnsMadeEasy
- Gandi
- Porkbun
See the DNS providers matrix for more details.
Add this to your Cargo.toml:
[dependencies]
zone-update = "0.1.0"use zone_update::{gandi, errors::Result};
use std::net::Ipv4Addr;
async 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_v4_record(host, &new_ip).await?;
Ok(())
}See the examples directory for other use-cases.
At this point the most useful contributions would be to add additional DNS provider APIs. However other contributions are welcome.
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. After all, if you can't be bothered to review it why should anybody else?
This project is licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.