1
0
mirror of https://github.com/danog/dns.git synced 2025-01-22 21:41:11 +01:00
Niklas Keller 1a41089d84 Fix BasicResolver::resolve to break redirect loop
Previously we queried domains usually five times (max redirects). It didn't have much impact, because these records were usually cached and immediately returned again, but this resulted in the TTL always being NULL due to cached records being returned.
2017-09-12 17:08:38 +02:00
2017-07-15 23:20:14 +02:00
2017-06-29 12:36:09 +02:00
2017-06-22 23:39:13 +02:00
2017-06-29 12:36:09 +02:00
2017-06-24 08:14:50 +02:00
2017-07-06 21:22:39 +02:00

dns

Build Status CoverageStatus License

amphp/dns provides asynchronous DNS name resolution for Amp.

Installation

composer require amphp/dns

Example

<?php

require __DIR__ . '/vendor/autoload.php';

use Amp\Dns;
use Amp\Loop;

Loop::run(function () {
    $githubIpv4 = yield Dns\resolve("github.com", Dns\Record::A);
    var_dump($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]);
    var_dump($firstGoogleResult);
    
    $combinedGoogleResult = yield Amp\Dns\resolve("google.com");
    var_dump($combinedGoogleResult);
    
    $googleMx = yield Amp\Dns\query("google.com", Amp\Dns\Record::MX);
    var_dump($googleMx);
});
Description
No description provided
Readme MIT 676 KiB
Languages
PHP 98.6%
Makefile 1.4%