Skip to content
The Chat Archive
grok-3-preview-02-24· xAI LMArena Human Preference 140K

I'm using pi-hole. In the web UI there is a query log that allows you to view DNS…

  1. User

    I'm using pi-hole. In the web UI there is a query log that allows you to view DNS requests from the various clients, including an indication of whether the request was allowed or denied. How can I filter the list on allowed or denied requests?

  2. Assistant

    Pi-hole's web UI (admin interface) provides a convenient way to view and analyze DNS query logs, including whether requests were allowed (permitted) or denied (blocked). However, the default interface does not have a built-in filter specifically for "allowed" or "denied" requests directly in the Query Log. To filter the list based on allowed or denied requests, you can use the following approaches:


    1. Use the Query Log Search Bar

    The Query Log in the Pi-hole web UI includes a search bar at the top of the page. You can use this to filter queries based on their status (allowed or denied). Here's how:

    • Filter for Denied (Blocked) Requests:

      • In the search bar, type blocked or denied. This will filter the list to show only queries that were blocked by Pi-hole (e.g., due to blocklists or blacklists).
    • Filter for Allowed (Permitted) Requests:

      • In the search bar, type OK or allowed. This will filter the list to show only queries that were permitted (e.g., forwarded to an upstream DNS server or cached).

    Note: The exact terminology in the search bar may depend on your Pi-hole version, so you may need to experiment with keywords like blocked, denied, OK, cached, or forwarded.


    2. Use the Status Column

    The Query Log includes a "Status" column that indicates whether a request was allowed or denied. While you cannot directly filter by clicking on the column, you can visually scan or use browser tools to help:

    • Allowed Requests: Look for statuses like OK (cached), OK (forwarded to...), or similar.
    • Denied Requests: Look for statuses like Blocked (gravity), Blocked (blacklist), or similar.

    To make this easier, you can use your browser's "Find" feature (Ctrl+F or Cmd+F) to search for keywords like blocked or OK within the page.


    3. Export and Analyze Logs (Advanced)

    If you need more advanced filtering or want to analyze logs outside the web UI, you can export the Pi-hole query logs and filter them using external tools. Here's how:

    • Access the Raw Logs: Pi-hole stores its query logs in a file located at /var/log/pihole.log. You can access this file via SSH or a terminal on the Pi-hole server.

    • Filter Logs Using Command-Line Tools: Use tools like grep to filter the logs for allowed or denied requests. For example:

      • Show Blocked Requests:
        grep "gravity blocked" /var/log/pihole.log
        
        This will show queries blocked by Pi-hole's blocklists (gravity).
      • Show Allowed Requests:
        grep "forwarded" /var/log/pihole.log
        
        This will show queries that were forwarded to an upstream DNS server (i.e., allowed).
    • Export Logs for Analysis: If you want to analyze the logs in a spreadsheet or another tool, you can copy the log file to your computer and use software like Excel, Google Sheets, or a text editor with filtering capabilities.


    4. Use the Long-Term Data (Query Log Analysis)

    Pi-hole also provides a "Long-term data" section in the web UI, which allows you to analyze historical query data. While this section doesn't allow direct filtering of allowed/denied requests, it can help you identify trends (e.g., top blocked domains, top permitted domains). To access this:

    1. Go to the Pi-hole web UI.
    2. Navigate to Long-term data > Query Log.
    3. Use the search or filtering options to analyze historical data.

    5. Request a Feature (Optional)

    If you find that the current filtering options in the Pi-hole web UI are insufficient, you can request a feature enhancement on the Pi-hole GitHub page or forums. The Pi-hole community is active, and feature requests are often considered for future updates.


    Summary

    • Use the search bar in the Query Log to filter for blocked or OK.
    • Visually scan the "Status" column or use browser search tools.
    • For advanced filtering, access the raw logs via /var/log/pihole.log and use command-line tools like grep.
    • Consider analyzing long-term data for trends.

    If you need further assistance or have a specific use case, feel free to ask!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.