diff --git a/lualib/dns.lua b/lualib/dns.lua index a38c00e6..6244b314 100644 --- a/lualib/dns.lua +++ b/lualib/dns.lua @@ -91,7 +91,7 @@ local function verify_domain_name(name) if not name:match("^[%l%d-%.]+$") then return false end - for w in name:gmatch("([%w-]+)%.?") do + for w in name:gmatch("([_%w%-]+)%.?") do if #w > MAX_LABEL_LEN then return false end @@ -113,7 +113,7 @@ end local function pack_question(name, qtype, qclass) local labels = {} - for w in name:gmatch("([%w-]+)%.?") do + for w in name:gmatch("([_%w%-]+)%.?") do table.insert(labels, string.pack("s1",w)) end table.insert(labels, '\0') @@ -282,7 +282,7 @@ function dns.resolve(name, ipv6) qdcount = 1, } local req = pack_header(question_header) .. pack_question(name, qtype, QCLASS.IN) - assert(dns_server, "Call dns.server fist") + assert(dns_server, "Call dns.server first") socket.write(dns_server, req) return suspend(question_header.tid, name, qtype) end