diff options
Diffstat (limited to 'it.class')
-rw-r--r-- | it.class | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -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) |