Home Contents | # resolver:resolve | Rawio | Core4 Lua Event System

## SYNOPSIS

1. resolver:resolve(question)
2. function resolver:result(question, success, result_or_error) ... end

## DESCRIPTION

Runs a DNS query. The question is a host name or an IP address in string form. If another query is currently running on this resolver instance, it is quietly discarded and no result is returned for the discarded query.

Processing of the query is done from within the event:poll() mainloop.

On completion, successful or not, the method resolver:result() is called. This callback is always called from within event:poll(), even on a cache hit.

A successful query is cached for as long as the TTL (time-to-live) data in the response indicates. Other queries for the same question will be fulfilled from the cache.

A failed query is cached for five seconds to prevent flooding the server. During that time, further queries for that question will fail immediately.

## RETURN VALUE

None.

## SEE ALSO

resolver:result()