Skip to content

Commit

Permalink
resolver: add NameServerConfigGroup::from_ips_quic
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangjingqiang authored and bluejekyll committed May 15, 2023
1 parent 2b78a1f commit aa892c6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crates/resolver/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,26 @@ impl NameServerConfigGroup {
)
}

/// Configure a NameServer address and port for DNS-over-QUIC
///
/// This will create a QUIC connections.
#[cfg(feature = "dns-over-quic")]
#[cfg_attr(docsrs, doc(cfg(feature = "dns-over-quic")))]
pub fn from_ips_quic(
ips: &[IpAddr],
port: u16,
tls_dns_name: String,
trust_negative_responses: bool,
) -> Self {
Self::from_ips_encrypted(
ips,
port,
tls_dns_name,
Protocol::Quic,
trust_negative_responses,
)
}

/// Creates a default configuration, using `8.8.8.8`, `8.8.4.4` and `2001:4860:4860::8888`, `2001:4860:4860::8844` (thank you, Google).
///
/// Please see Google's [privacy statement](https://developers.google.com/speed/public-dns/privacy) for important information about what they track, many ISP's track similar information in DNS. To use the system configuration see: `Resolver::from_system_conf` and `AsyncResolver::from_system_conf`
Expand Down

0 comments on commit aa892c6

Please sign in to comment.