-
-
Notifications
You must be signed in to change notification settings - Fork 562
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
Do not try to resolve hostname of clients in long-term data #1931
Conversation
Signed-off-by: Christian König <[email protected]>
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/top-clients-honor-dns-records-in-homepage-only/50512/15 |
This is a change in behavior and - even when I consider it to be a good one - I'll ask for a second review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I agree. I had thought about this from time to time - there is no guarantee that old clients still have the same IP
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/pi-hole-ftl-v5-11-web-v5-8-and-core-v5-6-released/50566/1 |
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: https://discourse.pi-hole.net/t/ips-instead-of-hostnames/50592/2 |
IMHO logging of IP-addresses is useless and human-unfriendly anyway. The preferred action should be to resolve IP-addresses prior to commiting to the log. I.e. at time of the event. |
git rebase
)git commit --signoff
)What does this PR aim to accomplish?:
Do not try to resolve client's IP to hostname for long-term data.
Two reasons:
This function was introduced by Long-term data: Resolve IPs to host names #690. It uses
gethostbyaddr
to resolve the IPs to hostnames. Therefore it uses the first name server configured in/etc/resolv.conf
. When the feature was introduced, Pi-hole had set itself (127.0.0.1
) as name server. Hence, the queries could be answered by Pi-hole.Now we do not set Pi-hole as name server for the host device anymore. Therefore queries will be forwarded to any upstream server configured in
resolv.conf
which might be unaware e.g. of "Local DNS Records".The long-term database can reach back as long as users want them to be. By default, it is one year. We can not be sure that a IP belonging to a specific client one year ago does still belong to the same client. Esp. if users do not use deterministic DHCP server.
How does this PR accomplish the above?:
Just remove obsolete code.