php-dns
php-dns copied to clipboard
Add 3rd parameter to getRecords to optionally skip filtering records
Fix for #53
Adds a 3rd parameter to getRecords to optionally skip filtering records. Backwards compatible with the original code.
This allows a lookup for any kind of record type (for example TXT
) to also return CNAME
records. This is consistent with how dig
also returns records.
I will take a look at this and the issue tonight, thanks for submitting!
Turns out this doesn't work for RemotelyLiving\PHPDNS\Resolvers\Dig
since that class appears to filter records before returning them regardless. That resolver class would require (breaking) rework in order to just return the record-set from the lookup.
Currently Dig
is incapable of returning the full record-set unless the ANY
type is provided (in which case it'll also query all types individually).
The CloudFlare
resolver however works different, as it does return the full record set and doesn't get filtered by type within the class itself. Arguably this is the correct way for resolvers to work as you'd want to manage the filtering within your application, as well as the fact that Dig
is in it's current form incapable of returning the actual results as the command dig
would.
I do think my PR still adds value, but I thought it'd be important to mention this.
@remotelyliving did you have a chance to look at this yet?