summaryrefslogtreecommitdiffstats
path: root/libc/dns/resolv/res_send.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/dns/resolv/res_send.c')
-rw-r--r--libc/dns/resolv/res_send.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/dns/resolv/res_send.c b/libc/dns/resolv/res_send.c
index 6439e31..a8da3ac 100644
--- a/libc/dns/resolv/res_send.c
+++ b/libc/dns/resolv/res_send.c
@@ -402,6 +402,10 @@ res_nsend(res_state statp,
}
if (statp->nscount == 0) {
+ // We have no nameservers configured, so there's no point trying.
+ // Tell the cache the query failed, or any retries and anyone else asking the same
+ // question will block for PENDING_REQUEST_TIMEOUT seconds instead of failing fast.
+ _resolv_cache_query_failed(statp->netid, buf, buflen);
errno = ESRCH;
return (-1);
}