Description
Describe the bug
Chain resolver with consensus might produce inpredictable results when there are some kind of round robin of the results or maybe when the result depends on geolocalisation.
For example looking up A
records for google.com
with consensus always return an empty result.
However, without chaining and consensus, it returns an unique result that changes (some round robin here) every request.
Also, the result completly differs if using cloudflare or google resolver.
When you do the same tests with for example microsoft.com
, multiple A
records are returned and the consensus is working.
So I was wondering is there could be a workaround for this or if it's better to drop using the chaining/consensus to avoid possible issues for some domains that would behave like google.com
does.
To Reproduce
Steps to reproduce the behavior:
Lookup A
record for hostname google.com
use RemotelyLiving\PHPDNS\Resolvers\GoogleDNS;
use RemotelyLiving\PHPDNS\Resolvers\CloudFlare;
use RemotelyLiving\PHPDNS\Resolvers\Chain;
$googleResolver = new GoogleDNS();
$cloudflareResolver = new CloudFlare();
$ipv4Result = $chainResolver->withConsensusResults()->getARecords('google.com');
print_r($ipv4Result);
Result:
RemotelyLiving\PHPDNS\Entities\DNSRecordCollection Object
(
[records:RemotelyLiving\PHPDNS\Entities\DNSRecordCollection:private] => ArrayIterator Object
(
[storage:ArrayIterator:private] => Array
(
)
)
)
Expected behavior
Get a list of A records for the hostname