Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate upstream servers by address AND port #923

Merged
merged 2 commits into from
Nov 15, 2020

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Nov 12, 2020

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?:

10


So far, FTL keeps servers apart solely based on their IP addresses. This is typically sufficient, however, users may decide to run different DNS servers on the same IP address. A popular example is, for instance, running FTL on 127.0.0.1#53 and unbound on 127.0.0.1#5353 where # is the dnsmasq-style port separator.

This PR extends the logic in FTL to identify upstream servers by both, address, and port. This also changes the format we store the server in the database. So far, the servers were saved without a port, in the future, they are stored like 127.0.0.1#53.

There is one expected cosmetic issue: FTL cannot know the port of the server responsible for queries in the database. Hence, immediately after switching to this branch, you'll note the assumed server 127.0.0.1#53 (even when the server may be sitting at #5353). This is merely a displaying issue as the content of the database will be correct at any time. I looked at providing simple solutions for this, however, it would make the code unreadable and - since the issue will be gone after 24 hours - it doesn't seem worth the effort.

Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER requested a review from a team November 12, 2020 23:27
@DL6ER DL6ER added the PR: Approval Required Open Pull Request, needs approval label Nov 12, 2020
@dschaper dschaper added PR: Approved Open Pull Request, Approved by required number of reviewers and removed PR: Approval Required Open Pull Request, needs approval labels Nov 14, 2020
@DL6ER DL6ER merged commit bd06f8d into development Nov 15, 2020
@DL6ER DL6ER deleted the new/api_upstream_details branch November 15, 2020 07:37
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-core-web-v5-2-and-ftl-v5-3-released/40909/1

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-core-web-v5-2-and-ftl-v5-3-released/40909/20

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/since-v-5-2-pi-hole-shows-two-entries-for-the-same-internal-dns-server/40952/6

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/new-gripes-w-latest-updates/41660/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement PR: Approved Open Pull Request, Approved by required number of reviewers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants