Skip to content

Instantly share code, notes, and snippets.

@kmagdziak
Last active November 5, 2021 04:36
Show Gist options
  • Save kmagdziak/49daac58bad7071e36a738da8aadb58e to your computer and use it in GitHub Desktop.
Save kmagdziak/49daac58bad7071e36a738da8aadb58e to your computer and use it in GitHub Desktop.
Running Pi-hole Docker Container with different docker port 80 mapping
Issue: Changing the docker port 80 to hosted port not 80 causes the following message:
[ERROR]: Unable to parse results from queryads.php: Unhandled error message (Invalid domain!)
## Solution courtesy of unitpas, modified by kmagdziak
docker exec -it pihole apt-get update
docker exec -it pihole apt-get install nano
docker exec -it pihole bash
nano /var/www/html/pihole/index.php
change
$serverName = htmlspecialchars($_SERVER["HTTP_HOST"]);
with
$serverName = htmlspecialchars($_SERVER["SERVER_ADDR"]);
Ctrl+O to save
Ctrl+X to exit
reload web page
@karezza
Copy link

karezza commented Jul 3, 2021

This also worked for me, looks like it needs to make it into the master branch.

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