1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! # modo::dns
//!
//! DNS-based domain ownership verification.
//!
//! Checks TXT record ownership and CNAME routing via raw UDP DNS queries.
//! Intended for custom-domain flows where a user must prove they control a
//! domain before activating it.
//!
//! # Provides
//!
//! - [`DnsConfig`] — nameserver address, TXT prefix, and timeout.
//! - [`DomainVerifier`] — performs TXT and CNAME lookups; `Arc`-backed, cheap
//! to clone.
//! - [`DomainStatus`] — result of [`DomainVerifier::verify_domain`] with
//! individual `txt_verified` / `cname_verified` booleans.
//! - [`DnsError`] — error variants with stable `"dns:<kind>"` codes.
//! - [`generate_verification_token`] — 13-char base36 token for TXT challenges.
//!
//! # Quick start
//!
//! ```rust,no_run
//! use modo::dns::{DnsConfig, DomainVerifier, generate_verification_token};
//!
//! # async fn example() -> modo::Result<()> {
//! let config = DnsConfig::new("8.8.8.8:53");
//! let verifier = DomainVerifier::from_config(&config)?;
//! let token = generate_verification_token();
//!
//! // User creates TXT record: _modo-verify.example.com -> "<token>"
//! let txt_ok = verifier.check_txt("example.com", &token).await?;
//! # Ok(())
//! # }
//! ```
pub
pub use DnsConfig;
pub use DnsError;
pub use generate_verification_token;
pub use ;