Skip to content

Windows error: DNS query for www.qq.com failed: too many retries #63

Closed

Description

@slince

Country: China
OS: win10
reactphp/dns Version: 0.4.9
DNS: 114.114.114.114

ipconfig /all

Output:

无线局域网适配器 WLAN:

   连接特定的 DNS 后缀 . . . . . . . :
   描述. . . . . . . . . . . . . . . : Intel(R) Dual Band Wireless-AC 3160
   物理地址. . . . . . . . . . . . . : 00-1E-64-F1-CE-21
   DHCP 已启用 . . . . . . . . . . . : 是
   自动配置已启用. . . . . . . . . . : 是
   本地链接 IPv6 地址. . . . . . . . : fe80::7c11:b96f:80de:4889%16(首选)
   IPv4 地址 . . . . . . . . . . . . : 192.168.1.112(首选)
   子网掩码  . . . . . . . . . . . . : 255.255.255.0
   获得租约的时间  . . . . . . . . . : 2017年6月22日 9:21:17
   租约过期的时间  . . . . . . . . . : 2017年6月22日 16:44:09
   默认网关. . . . . . . . . . . . . : 192.168.1.1
   DHCP 服务器 . . . . . . . . . . . : 192.168.1.1
   DHCPv6 IAID . . . . . . . . . . . : 83893860
   DHCPv6 客户端 DUID  . . . . . . . : 00-01-00-01-20-AE-FB-13-00-23-81-23-CA-07

   DNS 服务器  . . . . . . . . . . . : 114.114.114.114

   TCPIP 上的 NetBIOS  . . . . . . . : 已启用

Code:

$ip = gethostbyname('www.qq.com');
var_dump($ip);

Output:

string(13) "180.96.86.192"

Code:

$loop = React\EventLoop\Factory::create();
$factory = new React\Dns\Resolver\Factory();
$dns = $factory->create('114.114.114.114', $loop);

$dns->resolve('www.qq.com')->then(function ($ip) {
    echo "Host: $ip\n";
}, function(RuntimeException $exception){
    echo $exception->getMessage();
});
$loop->run();

Output:

DNS query for www.qq.com failed: too many retries

Activity

  1. clue commented on Jun 22, 2017

    @clue
    Member

    Thanks for reporting! It looks like #44 is there again :-)

    This was worked around via #53, but it looks like this was re-introduced via #61 and reactphp/stream#91. Note that #53 was actually only a work around, the real bug is actually #12.

    For now, you may be able either downgrade to react/stream < 0.7 or react/dns < 0.4.9 to work around this again. Can you verify this?

  2. clue commented on Jun 22, 2017

    @clue
    Member

    For the reference: This is actually a bug in certain PHP versions on Windows only. This was fixed with PHP 7.0.17 and PHP 7.1.3.

    See https://bugs.php.net/bug.php?id=74090 and php/php-src@89a5bd6.

    This means that we have plenty of possible work arounds here, but I'd still like to tackle #12 which should ultimately fix this for all versions 👍

  3. slince commented on Jun 22, 2017

    @slince
    Author

    I tried the 0.4.8 version, it's ok @clue 👍

  4. slince commented on Jun 22, 2017

    @slince
    Author

    Will this be fixedin a future version? @clue

  5. clue commented on Jun 22, 2017

    @clue
    Member

    Will this be fixedin a future version? @clue

    Absolutely! This is in fact already fixed in PHP, but once #12 is in, we will no longer rely on this fix alone and provide a more robust solution that also supports older PHP versions across all platforms 👍

  6. clue commented on Aug 10, 2017

    @clue
    Member

    Resolved via #74 :shipit:

  7. added this to the v0.4.10 milestone on Oct 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions