blob: 700439e5948a94498e278b5a420c413741ebe86f [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001diff --git a/src/forward.c b/src/forward.c
2index e3fa94b..ecf3b98 100644
3--- a/src/forward.c
4+++ b/src/forward.c
5@@ -789,9 +789,12 @@ void reply_query(int fd, int family, time_t now)
6
7 /* Note: if we send extra options in the EDNS0 header, we can't recreate
8 the query from the reply. */
9- if (RCODE(header) == REFUSED &&
10- forward->forwardall == 0 &&
11- !(forward->flags & FREC_HAS_EXTRADATA))
12+ if ((RCODE(header) == REFUSED &&
13+ forward->forwardall == 0 &&
14+ !(forward->flags & FREC_HAS_EXTRADATA)) ||
15+ /* If strict-order is set, try next server on NXDOMAIN reply */
16+ (RCODE(header) == NXDOMAIN && option_bool(OPT_ORDER) &&
17+ server->next != NULL))
18 /* for broken servers, attempt to send to another one. */
19 {
20 unsigned char *pheader;