AdguardTeam / dnsproxy

Simple DNS proxy with DoH, DoT, DoQ and DNSCrypt support
Apache License 2.0
2.38k stars 246 forks source link

dns stopped working after connection severed #395

Open ivanjx opened 5 months ago

ivanjx commented 5 months ago

if i restarted my isp router the dnsproxy just will not work anymore. only restarting the process manually (or the process will crash itself eventually) will make it work again. here is my config: -b 1.1.1.1:53 -u https://freedns.controld.com/no-ads-dating-drugs-gambling-malware-typo --http3 -v

and the logs:

2024/04/21 15:47:02 1#384 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABGt3czIDd2ViCHRlbGVncmFtA29yZwAAAQAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#468 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAAB3N5bmMtdjIFYnJhdmUDY29tAAABAAE\": timeout: no recent network activity"
2024/04/21 15:47:02 1#478 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABGt3czIDd2ViCHRlbGVncmFtA29yZwAAQQAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#472 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAAB3N5bmMtdjIFYnJhdmUDY29tAABBAAE\": timeout: no recent network activity"
2024/04/21 15:47:02 1#445 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAAB3N5bmMtdjIFYnJhdmUDY29tAABBAAE\": timeout: no recent network activity"
2024/04/21 15:47:02 1#479 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABGt3czUDd2ViCHRlbGVncmFtA29yZwAAAQAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#486 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABG55YWEHdHJhY2tlcgJ3ZgAAHAAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#482 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABGt3czUDd2ViCHRlbGVncmFtA29yZwAAQQAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#458 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABG55YWEHdHJhY2tlcgJ3ZgAAHAAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#467 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAAB3N5bmMtdjIFYnJhdmUDY29tAABBAAE\": timeout: no recent network activity"
2024/04/21 15:47:02 1#465 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABG55YWEHdHJhY2tlcgJ3ZgAAHAAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#453 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABG55YWEHdHJhY2tlcgJ3ZgAAHAAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#476 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAAB3N5bmMtdjIFYnJhdmUDY29tAAABAAE\": timeout: no recent network activity"
2024/04/21 15:47:02 1#446 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAAB3N5bmMtdjIFYnJhdmUDY29tAAABAAE\": timeout: no recent network activity"
2024/04/21 15:47:02 1#471 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAAB3N5bmMtdjIFYnJhdmUDY29tAAABAAE\": timeout: no recent network activity"
2024/04/21 15:47:02 1#474 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAAB3N5bmMtdjIFYnJhdmUDY29tAABBAAE\": timeout: no recent network activity"
2024/04/21 15:47:02 1#483 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABXZlbnVzA3dlYgh0ZWxlZ3JhbQNvcmcAAEEAAQ\": timeout: no recent network activity"
2024/04/21 15:47:02 1#484 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABXZlbnVzA3dlYgh0ZWxlZ3JhbQNvcmcAAAEAAQ\": timeout: no recent network activity"
2024/04/21 15:47:02 1#431 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABG55YWEHdHJhY2tlcgJ3ZgAAHAAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#455 [error] dnsproxy: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: response received over udp: "requesting https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo: Get \"https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo?dns=AAABAAABAAAAAAAABG55YWEHdHJhY2tlcgJ3ZgAAHAAB\": timeout: no recent network activity"
2024/04/21 15:47:02 1#448 [debug] dnsproxy: handling new udp packet from 172.1.0.12:33102
2024/04/21 15:47:02 1#448 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 62379
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;sync-v2.brave.com. IN  A
2024/04/21 15:47:02 1#513 [debug] dnsproxy: handling new udp packet from 172.1.0.12:54296
2024/04/21 15:47:02 1#448 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:02 1#513 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 39998
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;sync-v2.brave.com. IN  HTTPS
2024/04/21 15:47:02 1#513 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:02 1#515 [debug] dnsproxy: handling new udp packet from 172.1.0.12:49381
2024/04/21 15:47:02 1#515 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 18859
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;sync-v2.brave.com. IN  HTTPS
2024/04/21 15:47:02 1#514 [debug] dnsproxy: handling new udp packet from 172.1.0.12:51352
2024/04/21 15:47:02 1#515 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:02 1#514 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 21161
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;sync-v2.brave.com. IN  A
2024/04/21 15:47:02 1#514 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#506 [debug] dnsproxy: handling new udp packet from 172.1.0.12:43435
2024/04/21 15:47:03 1#500 [debug] dnsproxy: handling new udp packet from 172.1.0.12:36804
2024/04/21 15:47:03 1#506 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 52541
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;kws5.web.telegram.org. IN  A
2024/04/21 15:47:03 1#503 [debug] dnsproxy: handling new udp packet from 172.1.0.12:45598
2024/04/21 15:47:03 1#506 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#500 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 33432
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;kws5.web.telegram.org. IN  HTTPS
2024/04/21 15:47:03 1#504 [debug] dnsproxy: handling new udp packet from 172.1.0.12:34394
2024/04/21 15:47:03 1#503 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 7922
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;kws2.web.telegram.org. IN  HTTPS
2024/04/21 15:47:03 1#500 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#503 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#502 [debug] dnsproxy: handling new udp packet from 172.1.0.12:58131
2024/04/21 15:47:03 1#505 [debug] dnsproxy: handling new udp packet from 172.1.0.12:34372
2024/04/21 15:47:03 1#502 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 48760
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;venus.web.telegram.org. IN  A
2024/04/21 15:47:03 1#505 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 54879
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;venus.web.telegram.org. IN  HTTPS
2024/04/21 15:47:03 1#505 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#502 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#501 [debug] dnsproxy: handling new udp packet from 172.1.0.12:33336
2024/04/21 15:47:03 1#501 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 7492
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;kws2.web.telegram.org. IN  A
2024/04/21 15:47:03 1#501 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#504 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 17732
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;kws2.web.telegram.org. IN  A
2024/04/21 15:47:03 1#504 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#507 [debug] dnsproxy: handling new udp packet from 172.1.0.12:60242
2024/04/21 15:47:03 1#507 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 5796
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;kws2.web.telegram.org. IN  HTTPS
2024/04/21 15:47:03 1#507 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#460 [debug] dnsproxy: handling new udp packet from 172.1.0.12:44890
2024/04/21 15:47:03 1#460 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 11943
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;kws5.web.telegram.org. IN  A
2024/04/21 15:47:03 1#460 [debug] dnsproxy: cache: disabled; not caching
2024/04/21 15:47:03 1#510 [debug] dnsproxy: handling new udp packet from 172.1.0.12:52596
2024/04/21 15:47:03 1#510 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 50506

logs right before it crashed itself (i run this on a docker container so it auto restarted):

2024/04/21 16:03:22 1#16463 [debug] dnsproxy: cache: disabled    not caching        
2024/04/21 16:03:22 1#16464 [debug] dnsproxy: handling new udp packet from 172.1.0.12:33142         
2024/04/21 16:03:22 1#16358 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 47541            
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0          
         QUESTION SECTION:  
    174.0.1.172.in-addr.arpa.   IN   PTR
2024/04/21 16:03:22 1#16244 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 46995            
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0          
         QUESTION SECTION:  
    157.0.1.172.in-addr.arpa.   IN   PTR
2024/04/21 16:03:22 1#16358 [debug] dnsproxy: cache: disabled    not caching        
2024/04/21 16:03:22 1#16244 [debug] dnsproxy: cache: disabled    not caching        
2024/04/21 16:03:22 1#16465 [debug] dnsproxy: handling new udp packet from 172.1.0.12:49501         
2024/04/21 16:03:22 1#16465 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 49510            
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0          
         QUESTION SECTION:  
    149.0.1.172.in-addr.arpa.   IN   PTR
2024/04/21 16:03:22 1#16465 [debug] dnsproxy: cache: disabled    not caching        
2024/04/21 16:03:22 1#16464 [debug] github.com/AdguardTeam/dnsproxy/proxy.(*Proxy).logDNSMessage(): IN: ;; opcode: QUERY, status: NOERROR, id: 21910            
;; flags: rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0          
         QUESTION SECTION:  
    234.0.1.172.in-addr.arpa.   IN   PTR
2024/04/21 16:03:22 1#16464 [debug] dnsproxy: cache: disabled    not caching        
2024/04/21 16:03:23 1#1 [info] Starting dnsproxy v0.70.0            
2024/04/21 16:03:23 1#1 [debug] dnsproxy: upstream at index 0: https://freedns.controld.com:443/no-ads-dating-drugs-gambling-malware-typo           
2024/04/21 16:03:23 1#1 [info] dnsproxy: cache: disabled            
2024/04/21 16:03:23 1#1 [info] dnsproxy: starting dns proxy server          
2024/04/21 16:03:23 1#1 [info] dnsproxy: creating udp server socket 0.0.0.0:53          
2024/04/21 16:03:23 1#1 [info] dnsproxy: listening to udp://[::]:53         
2024/04/21 16:03:23 1#1 [info] dnsproxy: creating tcp server socket 0.0.0.0:53          
2024/04/21 16:03:23 1#1 [info] dnsproxy: listening to tcp://[::]:53         
2024/04/21 16:03:23 1#33 [info] dnsproxy: entering udp listener loop on [::]:53         
2024/04/21 16:03:23 1#34 [info] dnsproxy: entering tcp listener loop on [::]:53