dns_resolver::util::nameserver

Function query_nameserver

Source
pub async fn query_nameserver(
    address: SocketAddr,
    question: Question,
    recursion_desired: bool,
) -> Option<Message>
Expand description

Send a message to a remote nameserver, preferring UDP if the request is small enough. If the request is too large, or if the UDP response is truncated, tries again using TCP.

If an error occurs while sending the message or receiving the response, or the response does not match the request, None is returned.

This has a 5s timeout for each request, so 10s in total.