Skip to main content

Crate dns_update

Crate dns_update 

Source
Expand description

§dns-update

crates.io docs.rs crates.io

dns-update is an Dynamic DNS update library for Rust that supports updating DNS records using the RFC 2136 protocol and over 70 cloud, registrar, and self-hosted DNS provider APIs. It was designed to be simple and easy to use, while providing a high level of flexibility and performance.

§Supported providers

ProviderConstructorNotes
RFC 2136new_rfc2136_tsigTSIG authentication
Alibaba Cloud DNSnew_alidnsACS3-HMAC-SHA256
ArvanCloudnew_arvancloud
AutoDNSnew_autodnsInterNetX
Azure DNSnew_azurednsOAuth2 client credentials
Baidu Cloud DNSnew_baiducloudBCE-Auth-V1
BlueCat Address Manager v2new_bluecatv2OAuth
Bunny DNSnew_bunny
Cloudflarenew_cloudflareAPI token or X-Auth-*
ClouDNSnew_cloudns
Constellixnew_constellixHMAC-SHA1
cPanelnew_cpanelUAPI, API token
DDNSS.denew_ddnssTXT only
deSECnew_desec
DigitalOceannew_digitalocean
DNSimplenew_dnsimple
DNS Made Easynew_dnsmadeeasyHMAC-SHA1
Domeneshopnew_domeneshop
DreamHostnew_dreamhost
DuckDNSnew_duckdnsTXT only
Dynunew_dynu
EasyDNSnew_easydns
Akamai Edge DNSnew_edgednsEG1-HMAC-SHA256
Exoscalenew_exoscaleEXO2-HMAC-SHA256
FreeMyIPnew_freemyipTXT only
Gandi v5new_gandiv5LiveDNS
Gcorenew_gcore
GleSYSnew_glesys
GoDaddynew_godaddy
Google Cloud DNSnew_google_cloud_dnsService account JWT
Hetzner DNSnew_hetzner
hosting.denew_hostingde
Hostingernew_hostinger
Huawei Cloud DNSnew_huaweicloudSDK-HMAC-SHA256
Hurricane Electricnew_hurricaneTXT only
IBM Cloud (SoftLayer)new_ibmcloudClassic Infrastructure
Infoblox NIOSnew_infobloxWAPI
Infomaniaknew_infomaniak
INWXnew_inwxJSON-RPC
IONOSnew_ionos
IPv64new_ipv64TXT only
Jokernew_jokerDMAPI, API key or username/password
AWS Lightsailnew_lightsailAWS Sigv4
Linodenew_linode
LuaDNSnew_luadns
Mythic Beastsnew_mythicbeastsOAuth2
Namecheapnew_namecheapXML API
Name.comnew_namedotcom
NameSilonew_namesiloXML API
netcupnew_netcupJSON-RPC, session cache
Netlifynew_netlify
Nifcloudnew_nifcloudNIFTY3-HTTPS
NS1new_ns1
Oracle Cloud DNSnew_oraclecloudRSA-SHA256 HTTP Signatures
OVHnew_ovh
Plesknew_pleskREST API, X-API-Key
Porkbunnew_porkbun
AWS Route 53new_route53AWS Sigv4
ANS SafeDNSnew_safedns
Scalewaynew_scaleway
Spaceshipnew_spaceship
Tencent Cloud DNSPodnew_tencentcloudTC3-HMAC-SHA256
TransIPnew_transipRSA-SHA512 JWT
UltraDNSnew_ultradnsOAuth2
Vercelnew_vercel
Volcano Enginenew_volcengineHMAC-SHA256
Vultrnew_vultr
Websupportnew_websupportHMAC-SHA1
Yandex Cloud DNSnew_yandexcloudPS256 JWT

§Usage Example

Using RFC2136 with TSIG:

        // Create a new RFC2136 client
        let client = DnsUpdater::new_rfc2136_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();

§License

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.

Copyright (C) 2020, Stalwart Labs LLC

Modules§

bind
crypto
dnssec
dns security extension related modules
http
jwt
Generic JWT utility for providers that need JWT authentication.
providers
tests
update
utils

Structs§

KeyValue
MXRecord
NamedDnsRecord
A named DNS record, which consists of a name and a DNS record.
SRVRecord
TLSARecord

Enums§

Algorithm
A DNSSEC algorithm.
CAARecord
DnsRecord
A DNS record type with a value.
DnsRecordType
A DNS record type.
DnsUpdater
Error
TlsaCertUsage
TlsaMatching
TlsaSelector
TsigAlgorithm
A TSIG algorithm.

Traits§

IntoFqdn

Type Aliases§

Result