From 6acb5a45c6edc40051f34f424a8bf6096551e162 Mon Sep 17 00:00:00 2001 From: Dengfeng Liu Date: Fri, 10 Jan 2025 19:11:39 +0800 Subject: [PATCH] feat: update DNS configuration to use custom DNS for non-OpenWRT platforms Signed-off-by: Dengfeng Liu --- src/wd_util.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/wd_util.c b/src/wd_util.c index bf8fe9ed..abe25eb3 100644 --- a/src/wd_util.c +++ b/src/wd_util.c @@ -1457,10 +1457,11 @@ thread_evdns_parse_trusted_domain_2_ip(void *arg) } evdns_base_set_option(dnsbase, "timeout", config_get_config()->dns_timeout); - // thanks to the following article - // http://www.wuqiong.info/archives/13/ - evdns_base_set_option(dnsbase, "randomize-case:", "0");//TurnOff DNS-0x20 encoding - evdns_base_nameserver_ip_add(dnsbase, "127.0.0.1");//LocalDNS + evdns_base_set_option(dnsbase, "randomize-case", "0");//TurnOff DNS-0x20 encoding + if (is_openwrt_platform()) + evdns_base_nameserver_ip_add(dnsbase, "127.0.0.1");//LocalDNS + else + evdns_base_nameserver_ip_add(dnsbase, "1.1.1.1");//custom DNS struct evutil_addrinfo hints; LOCK_DOMAIN();