pi-hole / FTL

The Pi-hole FTL engine
https://pi-hole.net
Other
1.34k stars 187 forks source link

Improve internal DNS resolver #1976

Closed DL6ER closed 1 month ago

DL6ER commented 1 month ago

What does this implement/fix?

This PR implements TCP lookups for the internal DNS client used to derive names for clients and upstream servers. The reason for adding this was #1975 during which we have found that existing UDP lookups may fail silently because of UDP packet fragmentation/truncation. Using TCP avoids this issue altogether. It can reliably be triggered in development-v6 when setting 8.8.8.8 as upstream server and enabling DNSSEC validation.

While discussing #1975, we found another glitch that causes names of upstream servers to never be resolved when starting with no/an empty database. Only after the first restart of FTL after database initialization, upstream server names are resolved. This is fixed now as well.


Related issue or feature (if applicable): #1975

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. 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.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

DL6ER commented 1 month ago

Note that the failed spellcheck will be fixed by https://github.com/pi-hole/FTL/pull/1962