query_server(
host,qname,qtype,opts) ->resp,err
Send a single iterative (RD=0) DNS query to a specific server
Sends one DNS query with RD=0 (Recursion Desired off) to the server at
host. Returns the full decoded response message including all sections
(header, question, answer, authority, additional, edns).
qtype may be a string ("A", "AAAA", "NS", "MX") or a numeric
type code.
Optional opts fields:
port — server port (default 53)timeout — socket timeout in seconds (default 5)edns_buffer_size — EDNS advertised UDP payload size (default 4096);
set to false to disable EDNSAutomatically retries over TCP when the response has the TC (truncation) bit set.
local iter = require("dns.iter")
local resp, err = iter.query_server("198.41.0.4", "example.com.", "A")
if resp then
local kind, info = iter.classify(resp, 1)
print(kind) -- "referral"
end