diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2011-06-14 16:31:00 +0200 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2011-06-14 16:31:00 +0200 |
commit | 0100056707c0ca5c51bb0b8d88612a407be09ef1 (patch) | |
tree | 4e8c8d9d6920833a74ca058dc21d59b6587ec33c | |
parent | bc3be18145e4d57e7268506f123c0f0f373a15e2 (diff) |
resolv: try next server on SERVFAIL
in bug 3637 Andrey Kovalev aka pxe.ru writes:
getaddrinfo does NOT add domain to query when receive SERVFAIL
RFC1035 7.2 suggests that
- If a resolver gets a server error or other bizarre response
from a name server, it should remove it from SLIST, and may
wish to schedule an immediate transmission to the next
candidate server address.
So let's try the next server upon SERVFAIL even if it's not strictly
required.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r-- | libc/inet/resolv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index 021d5bf5d..e8b7f2bad 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -1461,7 +1461,7 @@ int attribute_hidden __dns_lookup(const char *name, /* bug 660 says we treat negative response as an error * and retry, which is, eh, an error. :) * We were incurring long delays because of this. */ - if (h.rcode == NXDOMAIN) { + if (h.rcode == NXDOMAIN || h.rcode == SERVFAIL) { /* if possible, try next search domain */ if (!ends_with_dot) { DPRINTF("variant:%d sdomains:%d\n", variant, sdomains); |