Commit 53d8c2fb authored by David Morley's avatar David Morley Committed by GitHub

Merge pull request #87 from noplanman/fix_ip_from_dns_regex

Fix the regex to get the A value of a DNS entry.
parents 5047f166 bcdfcd3e
......@@ -146,8 +146,8 @@ while ($row = pg_fetch_assoc($result)) {
exec(escapeshellcmd('delv @74.82.42.42 ' . $domain), $iplookup);
if ($iplookup) {
_debug('Iplookup', $iplookup, true);
$dnssec = in_array('; fully validated', $iplookup) ?? false ;
$getaonly = array_values(preg_grep('/A\s.*/', $iplookup));
$dnssec = in_array('; fully validated', $iplookup, true) ?? false ;
$getaonly = array_values(preg_grep('/\s+IN\s+A\s+.*/', $iplookup));
preg_match('/A\s(.*)/', $getaonly[0], $version);
$ip = trim($version[1]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment