Browse Source

log: reduce the number of Error logs and update readme

Nick Peng 2 years ago
parent
commit
bb39653f4a
4 changed files with 16 additions and 16 deletions
  1. 4 4
      ReadMe.md
  2. 5 5
      ReadMe_en.md
  3. 1 1
      src/dns_client.c
  4. 6 6
      src/dns_server.c

+ 4 - 4
ReadMe.md

@@ -4,7 +4,7 @@
 
 ![SmartDNS](doc/smartdns-banner.png)
 SmartDNS 是一个运行在本地的 DNS 服务器,它接受来自本地客户端的 DNS 查询请求,然后从多个上游 DNS 服务器获取 DNS 查询结果,并将访问速度最快的结果返回给客户端,以此提高网络访问速度。
-SmartDNS 同时支持指定特定域名 IP 地址,并高性匹配,可达到过滤广告的效果
+SmartDNS 同时支持指定特定域名 IP 地址,并高性匹配,可达到过滤广告的效果; 支持DOT(DNS over TLS)和DOH(DNS over HTTPS),更好的保护隐私。
 与 DNSmasq 的 all-servers 不同,SmartDNS 返回的是访问速度最快的解析结果。详细差异请看[常见问题](#常见问题)。
 
 支持树莓派、OpenWrt、华硕路由器原生固件和 Windows 系统等。  
@@ -103,7 +103,7 @@ rtt min/avg/max/mdev = 5.954/6.133/6.313/0.195 ms
    支持从域名所属 IP 地址列表中查找到访问速度最快的 IP 地址,并返回给客户端,提高网络访问速度。
 
 3. **支持多种查询协议**  
-   支持 UDP、TCP、TLS 和 HTTPS 查询,以及非 53 端口查询。
+   支持 UDP、TCP、DOT 和 DOH 查询,以及非 53 端口查询。
 
 4. **特定域名 IP 地址指定**  
    支持指定域名的 IP 地址,达到广告过滤效果、避免恶意网站的效果。
@@ -143,10 +143,10 @@ smartdns已经合入主流系统的软件仓库,可以直接使用系统安装
 
 系统|安装方式|说明|
 --|--|--
-openwrt|opkg update</br>opkg install luci-app-smartdns</br>opkg install smartdns|22.03之后的系统。软件源路径:https://downloads.openwrt.org/releases/
+openwrt|opkg update<br>opkg install luci-app-smartdns<br>opkg install smartdns|22.03之后的系统。软件源路径:https://downloads.openwrt.org/releases/
 ddwrt|官方最新固件service页面->SmartDNS Resolver->启用。|选择界面参考:https://forum.dd-wrt.com/demo/Services.html
 debian|apt-get install smartdns|
-entware|ipkg update</br>ipkg install smartdns|软件源路径:https://bin.entware.net/
+entware|ipkg update<br>ipkg install smartdns|软件源路径:https://bin.entware.net/
 
 ### 手工下载安装
 

+ 5 - 5
ReadMe_en.md

@@ -1,7 +1,7 @@
 # SmartDNS
 
 ![SmartDNS](doc/smartdns-banner.png)  
-SmartDNS is a local DNS server. SmartDNS accepts DNS query requests from local clients, obtains DNS query results from multiple upstream DNS servers, and returns the fastest access results to clients.  
+SmartDNS is a local DNS server. SmartDNS accepts DNS query requests from local clients, obtains DNS query results from multiple upstream DNS servers, and returns the fastest access results to clients. supports secure DNS protocols like DoT (DNS over TLS), DoH (DNS over HTTPS), better protect privacy,  
 Avoiding DNS pollution and improving network access speed, supports high-performance ad filtering.  
 Unlike dnsmasq's all-servers, smartdns returns the fastest access resolution. ([read more](#faq))
 
@@ -101,7 +101,7 @@ From the comparison, smartdns found the fastest IP address to visit www.baidu.co
    Supports finding the fastest access IP address from the IP address list of the domain name and returning it to the client to avoid DNS pollution and improve network access speed.
 
 3. **Support for multiple query protocols**  
-   Support UDP, TCP, TLS, HTTPS queries, and non-53 port queries, effectively avoiding DNS pollution.
+   Support UDP, TCP, DOT(DNS over TLS), DOH(DNS over HTTPS) queries, and non-53 port queries, effectively avoiding DNS pollution and protect privacy.
 
 4. **Domain IP address specification**  
    Support configuring IP address of specific domain to achieve the effect of advertising filtering, and avoid malicious websites.
@@ -135,10 +135,10 @@ smartdns can already be installed using system package management tools.
 
 System|Installation|Instructions|
 --|--|--
-openwrt|opkg update</br>opkg install luci-app-smartdns</br>opkg install smartdns|systems after 22.03. Software source: https://downloads.openwrt.org/releases/
+openwrt|opkg update<br>opkg install luci-app-smartdns<br>opkg install smartdns|systems after 22.03. Software source: https://downloads.openwrt.org/releases/
 ddwrt|latest firmware. goto services page abd enable SmartDNS Resolver. |Demo: https://forum.dd-wrt.com/demo/Services.html
 debian|apt-get install smartdns|
-entware|ipkg update</br>ipkg install smartdns|Software source: https://bin.entware.net/
+entware|ipkg update<br>ipkg install smartdns|Software source: https://bin.entware.net/
 
 ### Download the package
 
@@ -508,7 +508,7 @@ Note: Merlin firmware is derived from ASUS firmware and can theoretically be use
 |nftset|Domain nftset|None|nftset /domain/[#4\|#6\|-]:[family#nftable#nftset\|-][,#[4\|6]:[family#nftable#nftset\|-]]], `-` to ignore; the valid families are inet and ip for ipv4 addresses while the valid ones are inet and ip6 for ipv6 addresses; due to the limitation of nft, two types of addresses have to be stored in two sets|nftset /www.example.com/#4:inet#mytab#dns4,#6:-
 |nftset-timeout|nftset timeout enable|no|[yes\|no]|nftset-timeout yes
 |nftset-debug|nftset debug enable|no|[yes\|no]|nftset-debug yes
-|domain-rules|set domain rules|None|domain-rules /domain/ [-rules...]<br>`[-c\|-speed-check-mode]`: set speed check mode,same as parameter `speed-check-mode`<br>`[-a\|-address]`: same as  parameter `address` <br>`[-n\|-nameserver]`: same as parameter `nameserver`<br>`[-p\|-ipset]`: same as parameter `nftset`<br>`[-t\|-nftset]`: same as parameter `nftset`<br>`[-d\|-dualstack-ip-selection]`: same as parameter `dualstack-ip-selection`|domain-rules /www.example.com/ -speed-check-mode none
+|domain-rules|set domain rules|None|domain-rules /domain/ [-rules...]<br>[-c\|-speed-check-mode]: set speed check mode,same as parameter speed-check-mode<br>[-a\|-address]: same as  parameter `address` <br>[-n\|-nameserver]: same as parameter `nameserver`<br>[-p\|-ipset]: same as parameter `nftset`<br>[-t\|-nftset]: same as parameter `nftset`<br>[-d\|-dualstack-ip-selection]: same as parameter `dualstack-ip-selection`|domain-rules /www.example.com/ -speed-check-mode none
 | domain-set | collection of domains|None| domain-set [options...]<br>[-n\|-name]:name of set <br>[-t\|-type] [list]: set type, only support list, one domain per line <br>[-f\|-file]:file path of domain set<br> used with address, nameserver, ipset, nftset, example: /domain-set:[name]/ | domain-set -name set -type list -file /path/to/list <br> address /domain-set:set/1.2.4.8 |
 |bogus-nxdomain|bogus IP address|None|[IP/subnet], Repeatable| bogus-nxdomain 1.2.3.4/16
 |ignore-ip|ignore ip address|None|[ip/subnet], Repeatable| ignore-ip 1.2.3.4/16

+ 1 - 1
src/dns_client.c

@@ -2916,7 +2916,7 @@ static int _dns_client_send_packet(struct dns_query_struct *query, void *packet,
 	}
 
 	if (atomic_read(&query->dns_request_sent) <= 0) {
-		tlog(TLOG_ERROR, "Send query to upstream server failed, total server number %d", total_server);
+		tlog(TLOG_WARN, "Send query to upstream server failed, total server number %d", total_server);
 		return -1;
 	}
 

+ 6 - 6
src/dns_server.c

@@ -1588,7 +1588,7 @@ static int _dns_request_post(struct dns_server_post_context *context)
 
 	ret = _dns_reply_inpacket(request, context->inpacket, context->inpacket_len);
 	if (ret != 0) {
-		tlog(TLOG_ERROR, "replay raw packet to client failed.");
+		tlog(TLOG_WARN, "replay raw packet to client failed.");
 		return -1;
 	}
 
@@ -4313,7 +4313,7 @@ static int _dns_server_do_query(struct dns_request *request, int skip_notify_eve
 		0) {
 		request->request_wait--;
 		_dns_server_request_release(request);
-		tlog(TLOG_ERROR, "send dns request failed.");
+		tlog(TLOG_WARN, "send dns request failed.");
 		goto errout;
 	}
 
@@ -4451,7 +4451,7 @@ static int _dns_server_recv(struct dns_server_conn_head *conn, unsigned char *in
 
 	ret = _dns_server_do_query(request, 1);
 	if (ret != 0) {
-		tlog(TLOG_ERROR, "do query %s failed.\n", request->domain);
+		tlog(TLOG_WARN, "do query %s failed.\n", request->domain);
 		goto errout;
 	}
 	_dns_server_request_release_complete(request, 0);
@@ -4503,7 +4503,7 @@ static int _dns_server_prefetch_request(char *domain, dns_type_t qtype, int expi
 	_dns_server_request_set_enable_prefetch(request, expired_domain);
 	ret = _dns_server_do_query(request, 0);
 	if (ret != 0) {
-		tlog(TLOG_ERROR, "do query %s failed.\n", request->domain);
+		tlog(TLOG_WARN, "do query %s failed.\n", request->domain);
 		goto errout;
 	}
 
@@ -4956,7 +4956,7 @@ static void _dns_server_prefetch_expired_domain(struct dns_cache *dns_cache)
 	server_query_option.ecs_enable_flag = 0;
 
 	if (_dns_server_prefetch_request(dns_cache->info.domain, dns_cache->info.qtype, 1, &server_query_option) != 0) {
-		tlog(TLOG_ERROR, "prefetch domain %s, qtype %d, failed.", dns_cache->info.domain, dns_cache->info.qtype);
+		tlog(TLOG_WARN, "prefetch domain %s, qtype %d, failed.", dns_cache->info.domain, dns_cache->info.qtype);
 	}
 }
 
@@ -5186,7 +5186,7 @@ int dns_server_run(void)
 			}
 
 			if (_dns_server_process(conn_head, event, now) != 0) {
-				tlog(TLOG_ERROR, "dns server process failed.");
+				tlog(TLOG_WARN, "dns server process failed.");
 			}
 		}
 	}