From 1d8b1be135ed6e1dbae0f9bfe176d08664610ba9 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 1 Nov 2025 12:56:18 +0000 Subject: [PATCH] [Fix] Fix rspamd nameserver round-robin when using /etc/resolv.conf When nameservers are parsed from /etc/resolv.conf, rspamd was setting the upstream rotation strategy to RSPAMD_UPSTREAM_MASTER_SLAVE, which caused it to only use the first nameserver unless it failed. This behavior was inconsistent with the documented round-robin strategy and with the behavior when nameservers are explicitly configured via the configuration file. Fixed by changing the rotation strategy to RSPAMD_UPSTREAM_ROUND_ROBIN when parsing /etc/resolv.conf, matching the expected behavior. Fixes RSP-284 --- src/libserver/dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libserver/dns.c b/src/libserver/dns.c index b21ae9c8d6..f448b2a320 100644 --- a/src/libserver/dns.c +++ b/src/libserver/dns.c @@ -910,7 +910,7 @@ rspamd_dns_resolver_init(rspamd_logger_t *logger, rspamd_upstreams_set_flags(dns_resolver->ups, RSPAMD_UPSTREAM_FLAG_DNS); rspamd_upstreams_set_rotation(dns_resolver->ups, - RSPAMD_UPSTREAM_MASTER_SLAVE); + RSPAMD_UPSTREAM_ROUND_ROBIN); if (!rdns_resolver_parse_resolv_conf_cb(dns_resolver->r, "/etc/resolv.conf", -- 2.47.3