summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--it.class11
1 files changed, 7 insertions, 4 deletions
diff --git a/it.class b/it.class
index e634d44..5797e75 100644
--- a/it.class
+++ b/it.class
@@ -443,10 +443,13 @@ static function is_private_ip($host)
else
{
$ips = [];
- foreach (dns_get_record($host, DNS_A) as $record)
- $ips[] = $record['ip'];
- foreach (dns_get_record($host, DNS_AAAA) as $record)
- $ips[] = $record['ipv6'];
+ foreach ([DNS_A, DNS_AAAA] as $type)
+ {
+ $records = false;
+ for ($try = 0; $try < 3 && $records === false; $try++)
+ foreach ((array)($records = @dns_get_record($host, $type)) as $record)
+ $ips[] = $record[$type == DNS_A ? 'ip' : 'ipv6'];
+ }
}
foreach ($ips as $ip)