--- a/resolv/res_init.c +++ a/resolv/res_init.c @@ -183,7 +183,7 @@ __res_vinit(res_state statp, int preinit) { #endif statp->nsaddr.sin_family = AF_INET; statp->nsaddr.sin_port = htons(NAMESERVER_PORT); - statp->nscount = 0; + statp->nscount = 1; statp->ndots = 1; statp->pfcode = 0; statp->_vcsock = -1; @@ -420,7 +420,8 @@ __res_vinit(res_state statp, int preinit) { continue; } } - statp->nscount = nservall; + if (nservall > 0) + statp->nscount = nservall; #ifdef _LIBC if (nservall - nserv > 0) { statp->_u._ext.nscount6 = nservall - nserv;