Open w796933 opened 3 years ago
sir . how to Prohibit search engine reverse detection ? Because the dig command is blocking. Resulting in very low efficiency. Site 500 error.
if (string_find(useragent, "Googlebot") or
string_find(useragent, "bingbot") or
string_find(useragent, "Yahoo") or
string_find(useragent, "DuckDuckBot")) then
local getHostname = io.popen("dig -x " .. remote_ip .. " +short")
local resolvedHostname = getHostname:read("*a")
getHostname:close()
local getIP = io.popen("getent hosts " .. resolvedHostname)
local resolvedIP = getIP:read("*a")
getIP:close()
if (string_find(resolvedHostname, "google.com") or
string_find(resolvedHostname, "googlebot.com") or
string_find(resolvedHostname, "search.msn.com") or
string_find(resolvedHostname, "crawl.yahoo.net") or
string_find(resolvedHostname, "duckduckbot.duckduckgo.com")) then
Will consider adding support in the future userAgent whitelist ?