This PR adds further error logging concerning (intermittent) network issues. Currently, dnsmasq doesn't provide any further details, making debugging quite hard. This PR was triggered by https://github.com/pi-hole/pi-hole/issues/5608 which, eventually, turned out to be an external issue with other services on the same machine.
Example: Simulating network outage by unplugging the Ethernet cable
UDP
dig google.com
Before:
Apr 2 12:14:43 dnsmasq[3791404]: query[A] 154.google.com from 127.0.0.1
Apr 2 12:14:43 dnsmasq[3791404]: config error is REFUSED (EDE: network error)
Now:
Apr 2 12:14:43 dnsmasq[3791404]: query[A] 154.google.com from 127.0.0.1
Apr 2 12:14:43 dnsmasq[3791404]: failed to send UDP request: Network is unreachable
Apr 2 12:14:43 dnsmasq[3791404]: config error is REFUSED (EDE: network error)
TCP
dig google.com +tcp
Before:
Apr 2 11:53:02 dnsmasq[3801913]: query[A] google.com from 127.0.0.1
(editor's note: nothing else gets printed, the TCP connection silently dies)
Now:
Apr 2 11:53:02 dnsmasq[3801913]: query[A] google.com from 127.0.0.1
Apr 2 11:53:02 dnsmasq[3801913]: failed to send TCP(fast-open) packet: Network is unreachable
Apr 2 11:53:02 dnsmasq[3801913]: failed to send TCP(connect) packet: Network is unreachable
Other possible errors could be Connection reset by peer or No memory available.
These errors are also logged to the diagnosis system (rate-limited to not hammer the database):
These messages are de-duplicated based on the peer address (192.168.2.1#53 in the screenshot).
Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
I have commented my proposed changes within the code.
I am willing to help maintain this change if there are issues with it later.
What does this implement/fix?
This PR adds further error logging concerning (intermittent) network issues. Currently,
dnsmasq
doesn't provide any further details, making debugging quite hard. This PR was triggered by https://github.com/pi-hole/pi-hole/issues/5608 which, eventually, turned out to be an external issue with other services on the same machine.Example: Simulating network outage by unplugging the Ethernet cable
UDP
Before:
Now:
TCP
Before:
Now:
Other possible errors could be
Connection reset by peer
orNo memory available
.These errors are also logged to the diagnosis system (rate-limited to not hammer the database):
These messages are de-duplicated based on the peer address (
192.168.2.1#53
in the screenshot).Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.