"Query lists" => all-option to list more than 100 results

Hi,

I use the "Find Blocked Domain In Lists" / "Query lists"-option. I search for "Microsoft" and get the message "Over 100 results found for microsoft - This can be overridden using the -all option". So how to use the "all"-option? After searching for a solution in the internet it seems I have to edit the queries.js-File. What changes do I have to do to get the query-results on the screen?

Thanks

From the command terminal on the Pi: pihole -q -adlist -all microsoft

The option does not exist from the web admin gui:

pihole -q -h

Usage: pihole -q [option] <domain>
Example: 'pihole -q -exact domain.com'
Query the adlists for a specified domain

Options:
  -adlist             Print the name of the block list URL
  -exact              Search the block lists for exact domain matches
  -all                Return all query matches within a block list
  -h, --help          Show this help dialog
2 Likes

Like @schnugg, I get the same message in the web gui

Match found in Blacklist
   adbroker.mp.dse.microsoft.com
  [i] Over 100 results found for microsoft
        This can be overridden using the -all option

But the terminal shows me (with and without -all)

pi@nanopineo:~$ pihole -q -adlist Microsoft
 Match found in Blacklist
   adbroker.mp.dse.microsoft.com
pi@nanopineo:~$
pi@nanopineo:~$ pihole -q -adlist -all Microsoft
 Match found in Blacklist
   adbroker.mp.dse.microsoft.com
pi@nanopineo:~$

I am wondering wich output is right.

@jfb

Many thanks. It works. :slightly_smiling_face:

@TheME

The output is the same, twice "adbroker.mp.dse.microsoft.com"

So if adbroker.mp.dse.microsoft.com is the only entry then it shouldn't show the 'over 100 results found' message.
Or am i wrong?

Yes, you are right. But do you actually have over 100 entries with "Microsoft" in your lists? Probably you have over 100 entries and the error is that one entry is shown :slightly_smiling_face:

The script on the web GUI is using the same command as the command line, with the exception of the added "-all". Note that the "exact" modifier is selectable on the web GUI interface.

Run these two commands and there should be a difference in outputs:

pihole -q -adlist microsoft

pihole -q -adlist -all microsoft

I assume the script of the GUI is editable? If yes, in which file is the script located? :slightly_smiling_face:

/var/www/html/admin/queryads.php

the related javascript is here:

/var/www/html/admin/scripts/pi-hole/js/queryads.js

1 Like

Likely, both are.
Commands are normally case-sensitive in Unix unless stated otherwise.
So 'microsoft' and 'Microsoft' might very well produce different results :wink:

OK, many thanks JFB! :slightly_smiling_face: I edited the queryads.php and now I can see all results also in the GUI. I cant see the sense of the 100-result-restriction in the GUI ... :slightly_smiling_face:

If you think this should be changed, open a feature request. A quick search shows no open request for this.

1 Like

OK. Many thanks. Problem fully solved. :slightly_smiling_face:

Thanks @Bucking_Horn.
I now had a closer look into the code and the behavior.

  • If I query the lists on the web interface, the entered domain gets converted to lowercase in queryads.js.
    So I have no influence to upper/lower case.

  • But on the CLI the domain input in fact is case-sensitive.

Since the domain names are not case-sensitive, I wonder why this was made this way.
I expected that the CLI script does the low case convertion and not the Java Script.
Then the output from CLI and the web interface would always be equal.

At the moment I'm not sure if the gravity domains also gets converted to lower case as well.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.