You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: dns.rs
    path of file: ./repos/mirrord/mirrord/agent/src
    
    the code of the file until where you have to start completion: use std::{future, path::PathBuf};

use futures::{stream::FuturesOrdered, StreamExt};
use mirrord_protocol::{
    dns::{DnsLookup, GetAddrInfoRequest, GetAddrInfoResponse},
    DnsLookupError, RemoteResult, ResolveErrorKindInternal, ResponseError,
};
use tokio::{
    fs,
    sync::{
        mpsc::{Receiver, Sender},
        oneshot,
    },
};
use tokio_util::sync::CancellationToken;
use trust_dns_resolver::{system_conf::parse_resolv_conf, AsyncResolver, Hosts};

use crate::{
    error::{AgentError, Resu
    
    async fn do_lookup(etc_path: PathBuf, host: String) -> RemoteResult<DnsLookup> {
        let resolv_conf_path = etc_path.join("resolv.conf");
        let hosts_path = etc_path.join("hosts");

        let resolv_conf = fs::read(resolv_conf_path).await?;
        let hosts_conf = fs::read(hosts_path).await?;

        let (config, mut options) = parse_resolv_conf(resolv_conf)?;
        options.server_ordering_strategy =
            trust_dns_resolver::config::ServerOrderingStrategy::UserProvidedOrder;

        let mut resolver = AsyncResolver::tokio(config, options)?;

        let hosts = Hosts::default().read_hosts_conf(hosts_conf.as_slice())?;
        resolver.set_hosts(Some(hosts));

        let lookup = resolver
            .lookup_ip(host)
            .await
            .inspect(|lookup| tracing::trace!(?lookup, "Lookup finished"))?
            .into();

        Ok(lookup)
    }