//! Specifying the address of the DNS server to send requests to.
use std::io;
use log::*;
/// A **resolver** is used to obtain the IP address of the server we should
/// send DNS requests to.
#[derive(PartialEq, Debug)]
pub enum Resolver {
/// Read the list of nameservers from the system, and use that.
SystemDefault,
// Use a specific nameserver specified by the user.
Specified(Nameserver),
}
pub type Nameserver = String;
impl Resolver {
/// Returns a nameserver that queries should be sent to, possibly by
/// obtaining one based on the system, returning an error if there was a
/// problem looking one up.
pub fn lookup(self) -> io::Result