Small change to non-blocking DNS initialization.

The trailing dot on "localhost." circumvents use of /etc/hosts in
some environments (I saw it on FreeBSD 9.0-RELEASE-p3) and so emits
an actual DNS query.  When running the test suite, that would be
hundreds of useless queries.
This commit is contained in:
Jon Siwek 2012-09-07 15:15:48 -05:00
parent f6c9b69eda
commit 67d01ab9e9

View file

@ -124,7 +124,7 @@ nb_dns_init(char *errstr)
nd->s = -1;
/* XXX should be able to init static hostent struct some other way */
(void)gethostbyname("localhost.");
(void)gethostbyname("localhost");
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
snprintf(errstr, NB_DNS_ERRSIZE, "res_init() failed");