dns-orchestrator-provider
Unified DNS provider abstraction library for managing DNS records across multiple cloud platforms.
简体中文 | English
Features
- Unified Provider Trait - Single
DnsProviderinterface for all supported providers - Full DNS Record Lifecycle - Create, read, update, delete, and batch operations for common record types
- Type-Safe Credentials -
ProviderCredentialsenum prevents provider/credential mismatch - Consistent Error Model - Standardized
ProviderErrorvariants across providers - Retry on Transient Failures - Automatic retry with exponential backoff for network/timeout/rate-limit errors
- Feature-Flag Driven - Enable only required providers and TLS backend
Supported Providers
| Provider | Feature Flag | Auth Method | Credential Fields |
|---|---|---|---|
| Cloudflare | cloudflare |
Bearer Token | api_token |
| Aliyun DNS | aliyun |
ACS3-HMAC-SHA256 | access_key_id, access_key_secret |
| DNSPod | dnspod |
TC3-HMAC-SHA256 | secret_id, secret_key |
| Huawei Cloud DNS | huaweicloud |
AK/SK Signing | access_key_id, secret_access_key |
Quick Start
Install
Enable all providers (default):
[]
= { = "0.1", = ["all-providers"] }
Enable only selected providers:
[]
= { = "0.1", = false, = ["cloudflare", "rustls"] }
Feature Flags
Provider flags:
all-providers(default)cloudflarealiyundnspodhuaweicloud
TLS backend flags:
native-tlsrustls(default)
Usage
Create Provider and Query Data
use ;
async
Create Record
# use ;
# async
Batch Delete
# use ;
# async
Error Handling
All operations return Result<T, ProviderError>.
Common categories:
- Authentication:
InvalidCredentials - Resource conflicts/missing:
RecordExists,RecordNotFound,DomainNotFound - Validation/permission:
InvalidParameter,PermissionDenied,DomainLocked - Capacity/limits:
QuotaExceeded,RateLimited - Infrastructure:
NetworkError,Timeout,ParseError,SerializationError
Transient failures (NetworkError, Timeout, RateLimited) are retryable.
Architecture
Consumer (core/tauri/web)
-> create_provider(credentials)
-> Arc<dyn DnsProvider>
-> provider-specific implementation (Cloudflare/Aliyun/DNSPod/Huawei)
-> shared HTTP utility + unified error mapping
Detailed docs:
Development
# From repository root
License
MIT