Commit b2c9e70c authored by Timo Teräs's avatar Timo Teräs

fix dns resolving on certain systems

dig can emit spaces also instead of tabs.
parent cd613355
......@@ -26,9 +26,9 @@ function resolve(host, context)
if not dnscache[host] then
dnscache[host] = {}
for rec in io.popen('dig '' ANY'):lines() do
for rec in io.popen('dig -t ANY ' do
local name, rtype, addr =
string.match(rec, '^('..familypatterns.domain..')\t+%d+\t+IN\t+(A+)\t+(.+)')
string.match(rec, '^('..familypatterns.domain..')%s+%d+%s+IN%s+(A+)%s+(.+)')
if name and string.sub(name, 1, string.len(host) + 1) == host..'.' then
if rtype == 'A' then family = 'inet'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment