amphp / dns

Async DNS resolution for PHP based on Amp.
https://amphp.org/dns
MIT License
155 stars 32 forks source link

Improve Windows configuration loader #70

Open kelunik opened 6 years ago

kelunik commented 6 years ago

From https://github.com/kelunik/acme-client/issues/64#issuecomment-352306921:

The issue is in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces. Check NameServer and DhcpNameServer properties in all subkeys and remove or correct the ones which are wrong. The first one found will win, no matter if its available or not.

I think vendor\amphp\dns\lib\DefaultResolver.php#loadResolvConf function should check if the nameserver is available before using it. Or find a better way in windows to get the correct nameserver because the interfaces in this subkey where not consistent with the the interfaces listed elsewhere, also windows itself did not use this nameserver found by this function.

kelunik commented 6 years ago

We should investigate using WMIC, see https://github.com/reactphp/dns/pull/94.

Bilge commented 7 months ago

LOL?

The original issue is fixed in #114. WMIC is implemented in #115. An alternative based on PowerShell is implemented in #116. The latter two are just different interfaces for WMI.