-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
Hi.
I think it will be better if the bootstrapping process is able to resolve the resolver host ("dns.google") directly from system hosts file. Since the most popular public DoH providers have fixed IPs for their service domains, it is often beneficial to add these records to hosts file to speed up initialization.
- Google: https://dns.google/dns-query => 8.8.8.8
- CloudFlare: https://one.one.one.one/dns-query => 1.1.1.1
Currently, ares_gethostbyname does not consult the system hosts file, always sending query to the bootstrap DNS server.
To make c-ares use hosts file, when initializing c-ares using ares_init_options(), the char* lookups option of struct ares_options should be set to fb, which means consult the hosts file first, then resolve using DNS servers.
See: https://man.archlinux.org/man/ares_init_options.3.en#ARES_OPT_LOOKUPS
Metadata
Metadata
Assignees
Labels
No labels