Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
slince opened this issue Jun 22, 2017 · 6 comments · Fixed by #74
Closed

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

slince opened this issue Jun 22, 2017 · 6 comments · Fixed by #74

Comments

@slince
Copy link

slince commented Jun 22, 2017

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
@clue
Copy link
Member

clue commented Jun 22, 2017

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?

@clue
Copy link
Member

clue commented Jun 22, 2017

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 👍

@slince
Copy link
Author

slince commented Jun 22, 2017

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

@slince slince closed this as completed Jun 22, 2017
@slince
Copy link
Author

slince commented Jun 22, 2017

Will this be fixedin a future version? @clue

@clue
Copy link
Member

clue commented Jun 22, 2017

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 👍

@clue
Copy link
Member

clue commented Aug 10, 2017

Resolved via #74 :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants