| Crates.io | dns-update |
| lib.rs | dns-update |
| version | 0.1.5 |
| created_at | 2024-04-16 09:51:57.35678+00 |
| updated_at | 2025-07-27 15:31:03.131178+00 |
| description | Dynamic DNS update (RFC 2136 and cloud) library for Rust |
| homepage | https://github.com/stalwartlabs/dns-update |
| repository | https://github.com/stalwartlabs/dns-update |
| max_upload_size | |
| id | 1210092 |
| size | 153,396 |
dns-update is an Dynamic DNS update library for Rust that supports updating DNS records using the RFC 2136 protocol and different cloud provider APIs such as Cloudflare. It was designed to be simple and easy to use, while providing a high level of flexibility and performance.
async only.PRs to add more providers are welcome. The goal is to support as many providers as Go's lego library.
Using RFC2136 with TSIG:
// Create a new RFC2136 client
let client = Rfc2136Provider::new_tsig("tcp://127.0.0.1:53", "<KEY_NAME>", STANDARD.decode("<TSIG_KEY>").unwrap(), TsigAlgorithm::HmacSha512).unwrap();
// Create a new TXT record
client.create(
"test._domainkey.example.org",
DnsRecord::TXT {
content: "v=DKIM1; k=rsa; h=sha256; p=test".to_string(),
},
300,
"example.org",
)
.await
.unwrap();
// Delete the record
client.delete("test._domainkey.example.org", "example.org").await.unwrap();
Using a cloud provider such as Cloudflare:
// Create a new Cloudflare client
let client =
DnsUpdater::new_cloudflare("<API_TOKEN>", None::<String>, Some(Duration::from_secs(60)))
.unwrap();
// Create a new TXT record
client.create(
"test._domainkey.example.org",
DnsRecord::TXT {
content: "v=DKIM1; k=rsa; h=sha256; p=test".to_string(),
},
300,
"example.org",
)
.await
.unwrap();
// Delete the record
client.delete("test._domainkey.example.org", "example.org").await.unwrap();
Licensed under either of
at your option.
Copyright (C) 2020, Stalwart Labs LLC