Skip to main content

Module dns

Module dns 

Source
Available on crate feature network only.

Enumsยง

DnsResolutionError
An error returned by resolve_address.

Staticsยง

V4_NON_GLOBAL ๐Ÿ”’
IPv4 CIDR blocks that are not globally routable. Anything outside this set is treated as a public address.
V6_NON_GLOBAL ๐Ÿ”’
IPv6 CIDR blocks that are not globally routable.

Functionsยง

ensure_url_ip_global
If urlโ€™s host is an IP literal, validates that it is a globally routable address, returning DnsResolutionError::PrivateAddress if not. Hostnames and URLs without a host are passed through; they are expected to be validated by a connector-level DNS resolver at connect time.
is_global ๐Ÿ”’
is_global_v4 ๐Ÿ”’
is_global_v6 ๐Ÿ”’
resolve_address
Resolves a host address and ensures it is a global address when enforce_global is set. This parameter is useful when connecting to user-defined unverified addresses.