albertito / dnss

DNS over HTTPS [mirror]
https://blitiri.com.ar/git/r/dnss/
Other
125 stars 17 forks source link

FR: Rate-limit error logs #13

Open dseomn opened 3 months ago

dseomn commented 3 months ago

Hi,

My connection to my ISP recently went down for a short time, and dnss flooded the system logs with connect: network is unreachable errors. Would it be possible to add a rate limit to the logs so that, e.g., the same log message can't be logged more than once per second?

albertito commented 3 months ago

Hi! Thank you for opening this, sorry it took me so long to triage it.

This seems like a very reasonable feature request, will leave this open to track it :)

Do you have an example of the error messages you got overloaded with? So I know which ones to prioritize. No worries if not, I can simulate this if needed. Thank you!

dseomn commented 3 months ago

Here are the messages that were filling my logs. The first two had variations with different IP addresses. I'm slightly confused by the last two because dnss is running with --fallback_upstream=[::1]:14653. /etc/resolv.conf has nameserver 127.0.0.53, but I didn't think dnss used that.

server.go:105      resolver query error: POST failed: Post "https://dns.google/dns-query": dial tcp 8.8.4.4:443: connect: network is unreachable
server.go:106      dnsserver Handler: error: POST failed: Post \"https://dns.google/dns-query\": dial tcp 8.8.4.4:443: connect: network is unreachable
server.go:105      resolver query error: POST failed: Post "https://dns.google/dns-query": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
server.go:106      dnsserver Handler: error: POST failed: Post \"https://dns.google/dns-query\": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
server.go:105      resolver query error: POST failed: Post "https://dns.google/dns-query": dial tcp: lookup dns.google on 127.0.0.53:53: server misbehaving
server.go:106      dnsserver Handler: error: POST failed: Post \"https://dns.google/dns-query\": dial tcp: lookup dns.google on 127.0.0.53:53: server misbehaving