daverandom / addr
This package is abandoned and no longer maintained.
The author suggests using the amphp/dns package instead.
Async DNS resolution for Amp.
Fund package maintenance!
amphp
v2.0.0-beta.1
2021-12-15 23:00 UTC
Requires
- php: >=8
- ext-filter: *
- ext-json: *
- amphp/amp: ^3
- amphp/byte-stream: ^2
- amphp/cache: ^2
- amphp/parser: ^1
- amphp/windows-registry: ^1
- daverandom/libdns: ^2.0.2
- revolt/event-loop: ^0.1.1
Requires (Dev)
- amphp/php-cs-fixer-config: dev-master
- amphp/phpunit-util: ^3
- phpunit/phpunit: ^9
- dev-master
- v2.x-dev
- v2.0.0-beta.1
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.0
- v0.9.x-dev
- v0.9.15
- v0.9.14
- v0.9.13
- v0.9.12
- v0.9.11
- v0.9.10
- v0.9.9
- v0.9.8
- v0.9.7
- v0.9.6
- v0.9.5
- v0.9.4
- v0.9.3
- v0.9.2
- v0.9.1
- v0.9.0
- 0.8.x-dev
- v0.8.15
- v0.8.14
- v0.8.13
- v0.8.12
- v0.8.11
- v0.8.10
- v0.8.9
- v0.8.8
- v0.8.7
- v0.8.6
- v0.8.5
- v0.8.4
- v0.8.3
- v0.8.2
- v0.8.1
- v0.8.0
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-ext-async
- dev-dep/libdns-v3
- dev-inf-loop-many-requests
This package is not auto-updated.
Last update: 2022-02-01 12:36:11 UTC
README
amphp/dns
provides asynchronous DNS resolution for PHP based on Amp.
Installation
composer require amphp/dns
Example
<?php require __DIR__ . '/examples/_bootstrap.php'; use Amp\Dns; use Amp\Loop; Loop::run(function () { $githubIpv4 = yield Dns\resolve("github.com", Dns\Record::A); pretty_print_records("github.com", $githubIpv4); $googleIpv4 = Amp\Dns\resolve("google.com", Dns\Record::A); $googleIpv6 = Amp\Dns\resolve("google.com", Dns\Record::AAAA); $firstGoogleResult = yield Amp\Promise\first([$googleIpv4, $googleIpv6]); pretty_print_records("google.com", $firstGoogleResult); $combinedGoogleResult = yield Amp\Dns\resolve("google.com"); pretty_print_records("google.com", $combinedGoogleResult); $googleMx = yield Amp\Dns\query("google.com", Amp\Dns\Record::MX); pretty_print_records("google.com", $googleMx); });