amphp / dns

Async DNS resolution for PHP based on Amp.

Home Page:https://amphp.org/dns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing check whether IP version is right on resolve

kelunik opened this issue · comments

Calling resolve with an IP address currently simply resolves to chat address. But it doesn't check whether it's allowed by the current "types" in $options:

var_dump(yield Amp\Dns\resolve('8.8.8.8', ['types' => Amp\Dns\Record::AAAA])); works just fine, but should result in an exception, because no records found. Or for the AAAAA case, we can rewrite it to an IPv6 address.

This will be resolved in the Amp v2 version.