From adcb263f4a2c05abce57c466e6f72db7b82774f3 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Sat, 19 Dec 2020 17:52:59 +0300 Subject: [PATCH] Do not resolve IPv4/v6 addresses to prevent slowdown --- generate-pac.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/generate-pac.sh b/generate-pac.sh index b408a1c..b57898e 100755 --- a/generate-pac.sh +++ b/generate-pac.sh @@ -86,7 +86,11 @@ echo " if (domains.length < 10) return \"DIRECT\"; // list is broken var curarr = domains[curzone][curhost.length]; } - var oip = dnsResolve(host); + var oip = false; + if (! host.match(/^[0-9a-fA-F:.]*$/)) { + // Do not resolve IPv4/v6 addresses to prevent slowdown + oip = dnsResolve(host); + } var iphex = \"\"; if (oip) { iphex = oip.toString().split(\".\");