Struct trust_dns_resolver::Resolver
[−]
[src]
pub struct Resolver { /* fields omitted */ }
The Resolver is used for performing DNS queries.
For forward (A) lookups, hostname -> IP address, see: Resolver::lookup_ip
Methods
impl Resolver
[src]
fn new(config: ResolverConfig, options: ResolverOpts) -> Result<Self>
[src]
Constructs a new Resolver with the specified configuration.
Arguments
config
- configuration for the resolveroptions
- resolver options for performing lookupsclient_connection
- ClientConnection for establishing the connection to the DNS server
Returns
A new Resolver
fn from_system_conf() -> Result<Self>
[src]
Constructs a new Resolver with the system configuration.
This will read the systems /etc/cresolv.conf
on Unix OSes.
fn lookup(&self, name: &str, record_type: RecordType) -> Result<Lookup>
[src]
Generic lookup for any RecordType
WARNING This interface may change in the future
Arguments
name
- name of the record to lookup, if name is not a valid domain name, an error will be returnedrecord_type
- type of record to lookup
fn lookup_ip(&self, host: &str) -> Result<LookupIp>
[src]
Performs a dual-stack DNS lookup for the IP for the given hostname.
See the configuration and options parameters for controlling the way in which A(Ipv4) and AAAA(Ipv6) lookups will be performed. For the least expensive query a fully-qualified-domain-name, FQDN, which ends in a final .
, e.g. www.example.com.
, will only issue one query. Anything else will always incur the cost of querying the ResolverConfig::domain
and ResolverConfig::search
.
Arguments
host
- string hostname, if this is an invalid hostname, an error will be returned.
fn lookup_service(
&self,
service: &str,
protocol: &str,
name: &str
) -> Result<SrvLookup>
[src]
&self,
service: &str,
protocol: &str,
name: &str
) -> Result<SrvLookup>
Performs a DNS lookup for an SRV record for the speicified service type and protocol at the given name.
This is a convenience method over lookup_srv
, it combines the service, protocol and name into a single name: _service._protocol.name
.
Arguments
service
- service to lookup, e.g. ldap or httpprotocol
- wire protocol, e.g. udp or tcpname
- zone or other name at which the service is located.
fn reverse_lookup(&self, query: IpAddr) -> Result<ReverseLookup>
[src]
Performs a lookup for the associated type.
Arguments
query
- a type which can be converted toName
viaFrom
.
fn ipv4_lookup(&self, query: &str) -> Result<Ipv4Lookup>
[src]
Performs a lookup for the associated type.
hint queries that end with a '.' are fully qualified names and are cheaper lookups
Arguments
query
- a str which parses to a domain name, failure to parse will return an error
fn ipv6_lookup(&self, query: &str) -> Result<Ipv6Lookup>
[src]
Performs a lookup for the associated type.
hint queries that end with a '.' are fully qualified names and are cheaper lookups
Arguments
query
- a str which parses to a domain name, failure to parse will return an error
fn mx_lookup(&self, query: &str) -> Result<MxLookup>
[src]
Performs a lookup for the associated type.
hint queries that end with a '.' are fully qualified names and are cheaper lookups
Arguments
query
- a str which parses to a domain name, failure to parse will return an error
fn srv_lookup(&self, query: &str) -> Result<SrvLookup>
[src]
Performs a lookup for the associated type.
hint queries that end with a '.' are fully qualified names and are cheaper lookups
Arguments
query
- a str which parses to a domain name, failure to parse will return an error
fn txt_lookup(&self, query: &str) -> Result<TxtLookup>
[src]
Performs a lookup for the associated type.
hint queries that end with a '.' are fully qualified names and are cheaper lookups
Arguments
query
- a str which parses to a domain name, failure to parse will return an error