1
0
mirror of https://github.com/danog/dns.git synced 2025-01-22 13:31:12 +01:00
Niklas Keller 2c8133a7b4 Allow empty domain names to be decoded
This is a rather long standing issue. LibDNS didn't allow to decode empty domain names. Empty domain names were previously only observed with PTR records, but were now also observed in regular queries in authoritative records that include the root nameservers.

LibDNS 2.0 mainly adds scalar types has just a few breaking changes. We don't expose it anywhere, so an upgrade is perfectly fine.

Fixes #53.
2018-01-10 17:26:11 +01:00
2017-12-14 19:16:25 +01:00
2017-06-22 23:39:13 +02:00
2017-09-27 14:49:02 +02:00
2017-12-15 17:14:52 +01: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%