Skip to content

pi-hole web-ui when adding domain to blocklist via the query page it is still being displayed and the button to block the domain is still present #1202

Open

Description

@mhussaincov

In raising this issue, I confirm the following: {please fill the checkboxes, e.g: [X]}

How familiar are you with the the source code relevant to this issue?:

{Replace this with a number from 1 to 10. 1 being not familiar, and 10 being very familiar}
1

Expected behaviour:

after a domain is added to the blocklist the domain should not be listed any more
{A detailed description of what you expect to see}
I expect the domain to have a button that says blacklist converted to whitelist to signifie that the domain has been blacklisted or whitelisted.

Actual behaviour:
the button that states blacklist is still present below the domain
so i blacklist github.com via this url:
http://pi.hole/admin/queries.php?client=192.168.122.1
I wate a few seconds,
and refresh the page using control plus f5
the button that says blacklist is still there
it has not turned in to a button that says whitelist.
I hope this makes sence,

{A detailed description and/or screenshots of what you do see}

Steps to reproduce:

  1. log in to your pi-hole webui

go to one of your named clients where it says
top clients total
and click on one of the names of your connected clients.
3.
try to block a domain
4.
refresh the page after a few seconds.
5
you will see that the blacklist button is still present
below the domain you just tryed blacklisting,
note, the domain does get blacklisted.
it is not displayed on the web-ui.

{Detailed steps of how we can reproduce this}

Debug token provided by uploading pihole -d log:

{Alphanumeric token}

Troubleshooting undertaken, and/or other relevant information:
i'm running pi-hole on the dev-trane,
and understand that breakages are a feature of this.
updated to the very latest dev version
{Steps of what you have done to fix this}

Activity

  1. transferred this issue frompi-hole/pi-holeon Apr 3, 2020
  2. github-actions commented on Jan 11, 2022

    @github-actions
    Contributor

    This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

  3. yubiuser commented on Jan 12, 2022

    @yubiuser
    Member

    I just tried it, it is still reproducible. I think the issue here is that we don't check the black/whitelist when we reload data from memory.

  4. rdwebdesign commented on Oct 19, 2022

    @rdwebdesign
    Member

    I'm not sure this problem is related to records on memory holding the previous states.

    I think the buttons (and background colors) are selected according to what happened when the query was made.
    This table shows the historical blocking status (recorded when the query was made), not the current blocking status.

    The button will never change, because the code never checks the current blocking status of each domain (it uses what is on the database).

  5. yubiuser commented on Oct 20, 2022

    @yubiuser
    Member

    You're right. With the current implementation it will never change the button. It decides only based on the status of the domain when it was made.

    https://github.com/pi-hole/AdminLTE/blob/c2afe4221ac275a1c082e1d8e14ccbb6113b0e7b/scripts/pi-hole/js/queries.js#L123-L130

    We would need to de-couple the button from the query status

  6. rdwebdesign commented on Oct 20, 2022

    @rdwebdesign
    Member

    To achieve this, we would need to verify the status of every domain during the HTML table creation.

  7. DL6ER commented on Mar 25, 2026

    @DL6ER
    Member

    Still relevant in v6. The Allow/Block buttons in the query log are rendered from the query's historical status, not the domain's current list membership. The fix would require checking each domain against the current allow/deny lists during table rendering (as already noted)

    Low-priority UX issue — the button still works, it just doesn't reflect that the action was already taken. Suggest relabeling as enhancement/low-priority.

  8. github-actions commented on Apr 24, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

  9. added
    never-stale
    and removed on Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancementnever-stale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions