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
Internal name resolving functionality #253
Conversation
…ts of already extensively tested code that was present in pre-FTLDNS for over a year. This implementation is only slightly different by ensuring that name resolution is done in a specific non-blocking way. Signed-off-by: DL6ER <dl6er@dl6er.de>
This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there: |
… resolve 0.0.0.0 Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
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.
Approved
free(ip); | ||
//free(name); // This is just the same as ip |
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.
It doesn't look like you even need to allocate ip
anymore?
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.
That's true. I will change it directly on the FTLDNS
branch.
// This has to be run outside of the thread locks | ||
// to prevent locking the resolver | ||
resolveNewClients(); | ||
|
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.
If the user disables the database, then the clients will never be resolved. Maybe move this to gc.c
?
* Network-wide ad blocking via your own hardware. | ||
* | ||
* FTL Engine | ||
* DNS Client Implementation |
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.
Specifically, DNS Client Hostname Resolution
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.
Well, it is also a DNS client implementation in the sense of that it queries the DNS server
By submitting this pull request, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your PR:
Please submit all pull requests against the
development
branch. Failure to do so will delay or deny your requestHow familiar are you with the codebase?:
10
This re-implements lots of already extensively tested code that was present in pre-FTLDNS for over a year. This implementation is only slightly different by ensuring that name resolution is done in a specific non-blocking way.
Before saving to the database (every minute by default), FTLDNS tries to obtain host names for clients and forward destinations that first appeared within this minute.
After garbage collection (once per hour by default), FTLDNS tries to re-obtain the host names for all clients that had at least one query in the selected time interval (24 hours by default). Host names of forward destinations are expected to not change.
This removes the necessity for doing the name lookups on the client side (or on an intermediate level like PHP as is currently implemented).