From 3803735fda0a9d7d003cb59d6d7db3de60c372f0 Mon Sep 17 00:00:00 2001 From: onefang Date: Wed, 26 Jun 2019 14:56:47 +1000 Subject: Changes in how the DNS entries are scanned. Fork more of the tests basically. --- mirror-checker.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/mirror-checker.lua b/mirror-checker.lua index 142c5e3..197e6c1 100755 --- a/mirror-checker.lua +++ b/mirror-checker.lua @@ -257,29 +257,33 @@ forkIP = function (orig, host) local ph = url.parse("http://" .. host, defaultURL) gatherIPs(ph.host) for k, v in pairs(IP[ph.host]) do + D("DNS record " .. v .. " " .. k .. " for " .. ph.host) if v == "A" then - if testing("IPv4") then execute("sleep 1; ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. host .. " " .. k .. " &") end + if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. " " .. k .. " &") end elseif v == "AAAA" then - if testing("IPv6") then execute("sleep 1; ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. host .. " [" .. k .. "] &") end - elseif v == "CNAME" then - forkIP(orig, k) + if testing("IPv6") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. " [" .. k .. "] &") end + elseif v == "CNAME" then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. k .. " &") + forkIP(orig, k) -- Check the original as well as the CNAME, so they both get checked. end end end -checkIP = function (orig, host, path, ip) +checkHost = function (orig, host, path, ip) + if nil == host then host = orig end + if nil == path then path = "" end if nil ~= ip then checkPaths(orig, ip, path) else - D("checkIP " .. orig .. " " .. host) + D("checkHost " .. orig .. " " .. host) gatherIPs(host) for k, v in pairs(IP[host]) do + D("DNS record " .. v .. " " .. k .. " for " .. host) if v == "A" then - if testing("IPv4") then checkPaths(orig, k, path) end + if testing("IPv4") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. path .. " " .. k .. " &") end elseif v == "AAAA" then - if testing("IPv6") then checkPaths(orig, "[" .. k .. "]", path) end - elseif v == "CNAME" then - checkIP(orig, k, path) + if testing("IPv6") then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. orig .. path .. " [" .. k .. "] &") end + elseif v == "CNAME" then execute("ionice -c3 ./mirror-checker.lua " .. sendArgs .. " " .. k .. path .. " &") + checkHost(orig, k, path) -- Check the original, with the DNS records from the CNAME, as well as the CNAME, so they both get checked. end end end -- cgit v1.1