clue · GitHub

This changeset updates the DNS Factory to accept a complete Config object instead of only a single DNS nameserver. If the given config contains more than one DNS nameserver, only the primary will be used at the moment. A future version may take advantage of fallback DNS servers (#6).

// old (still supported)
$config = React\Dns\Config\Config::loadSystemConfigBlocking();
$server = $config->nameservers ? reset($config->nameservers) : '8.8.8.8';
$resolver = $factory->create($server, $loop);
// new
$config = React\Dns\Config\Config::loadSystemConfigBlocking();
if (!$config->nameservers) {
    $config->nameservers[] = '8.8.8.8';
}
$resolver = $factory->create($config, $loop);

This is a prerequisite for supporting multiple DNS servers (#6) that will be added in a follow-up PR. Additionally, this can be used as a basis to respect more settings from the DNS config in the future (#158 and #98) as well as optional EDNS0 support (#100). This is a pure future addition that works across all supported platforms and does not affect BC.

Read the original on github.com ↗