From 0100056707c0ca5c51bb0b8d88612a407be09ef1 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 14 Jun 2011 16:31:00 +0200 Subject: 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 --- libc/inet/resolv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc/inet/resolv.c') 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); -- cgit v1.2.3