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

Extend regex extension ;querytype=... #1527

Merged
merged 3 commits into from
Feb 1, 2023

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Jan 28, 2023

What does this implement/fix?

;querytype=...A accepts now also a list (like ;querytype=A,AAAA,MX). You can use the exclamation mark as before for inversion (querytype=!A) matches everything BUT type A queries. This has now been extended to be able to invert a list, too (like ;querytype=!A,AAAA matching everything BUT A and AAAA queries).

Related issue or feature (if applicable): N/A

Pull request in docs with documentation (if applicable): TODO, extend description of Pi-hole regex extensions at https://docs.pi-hole.net/regex/pi-hole/#only-match-specific-query-types


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:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

…abc;querytype=HTTPS,SVCB"

Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de>
…A,MX). You can use the exclamation mark as before for inversion (querytype=!A) matches everything BUT type A queries. This has now been extended to be able to invert a list, too (like (querytype=!A,AAAA matches everything BUT A and AAAA queries)

Signed-off-by: DL6ER <dl6er@dl6er.de>
@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/whitelist-always-wins/60477/9

@jpgpi250
Copy link

Pi-hole version is v5.15.3 (Latest: v5.15.3)
AdminLTE version is v5.18.3 (Latest: v5.18.3)
FTL version is new/regex_multiple_query_types vDev-49e1c74 (Latest: v5.20.1)

Tested this branch, my comments here.

Everything appears to be working as expected.

@DL6ER DL6ER marked this pull request as ready for review January 29, 2023 17:11
@DL6ER DL6ER requested a review from a team January 29, 2023 17:11
@DL6ER DL6ER merged commit e938e27 into development Feb 1, 2023
@DL6ER DL6ER deleted the new/regex_multiple_query_types branch February 1, 2023 20:36
@yubiuser
Copy link
Member

yubiuser commented Feb 3, 2023

[2023-02-03 20:17:16.915 107798/T107814] Compiling blacklist regex 26 (DB ID 262): test1.com;querytype=!A,AAAA,MX
[2023-02-03 20:17:16.915 107798/T107814]     Hint: This regex matches only specific query types:
[2023-02-03 20:17:16.915 107798/T107814]       - ANY
[2023-02-03 20:17:16.915 107798/T107814]       - SRV
[2023-02-03 20:17:16.915 107798/T107814]       - SOA
[2023-02-03 20:17:16.915 107798/T107814]       - PTR
[2023-02-03 20:17:16.915 107798/T107814]       - TXT
[2023-02-03 20:17:16.915 107798/T107814]       - NAPTR
[2023-02-03 20:17:16.915 107798/T107814]       - DS
[2023-02-03 20:17:16.915 107798/T107814]       - RRSIG
[2023-02-03 20:17:16.915 107798/T107814]       - DNSKEY
[2023-02-03 20:17:16.915 107798/T107814]       - NS
[2023-02-03 20:17:16.915 107798/T107814]       - OTHER
[2023-02-03 20:17:16.915 107798/T107814]       - SVCB
[2023-02-03 20:17:16.915 107798/T107814]       - HTTPS

Is OTHER= everything else, also not listed here?

@DL6ER
Copy link
Member Author

DL6ER commented Feb 4, 2023

Well, not exactly. It means everything else not listed here (without the "also").

Pi-hole has OTHER since quite a while. The first time this query type showed up quite a lot was when Apple rushed forward and delighted us with HTTPS and SVCB queries. Since we adopted them, they are recognized on their own. Today, OTHER summarized, for instance, the various proprietary DNS records in the private range which we will never see on the web but users in corresponding environment may still be able to block (or unblock!) them.

Note that since some versions ago, the Query Log won't actually show OTHER but be more precise and show something like TYPE67 (so users can go to the IANA list and identify what this actually means). Behind the scenes, these TYPExyz queries are all considered OTHER by Pi-hole's filter.

@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-ftl-v5-21-web-v5-18-4-and-core-v5-15-4-released/61096/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants