classify(
resp,qtype,qname) ->kind,info
Classify a decoded DNS response
Classifies a decoded DNS response message into one of six categories.
qtype is the numeric query type used in the original query.
Returns kind (string) and info (table) where kind is one of:
"answer" — authoritative or cached answer with matching records;
info: {records = {...}, authoritative = true|false}"cname" — CNAME in answer section without matching records for qtype;
info: {target = "canonical.example.com."}"referral" — delegation to another nameserver (NS in authority, no
answer); info: {zone = "com.", ns = {...}, glue = {...}}"nxdomain" — name does not exist (RCODE 3);
info: {soa = <SOA record or nil>}"nodata" — name exists but has no records of requested type;
info: {soa = <SOA record or nil>}"error" — server error (SERVFAIL, REFUSED, etc.);
info: {rcode = <number>, rcode_name = "SERVFAIL"}local iter = require("dns.iter")
local resp = iter.query_server("198.41.0.4", "example.com.", "A")
local kind, info = iter.classify(resp, 1) -- 1 = TYPE.A