Dnsmasq_listening=all

I need my pihole to use the setting for dnsmasq to "permit all origins" but every time at boot it reverts to "respond only on interface docker0"

I have edited /etc/pihole/pihole-FTL.conf to have both SOCKET_LISTENING=all DNSMASQ_LISTENING=all

I added file /etc/dnsmasq.d/f***-this.conf to have except-interface=nonexisting
^^ did not use *** in the file name, used a few letters but trying to censor for the sake of the public.

I have gone to the UI and manually selected "permit all origins" which works, until reboot.

-- this is why I am angry, frustrate and ready to punch someone in the face..... WHEN I CLICK SAVE, WHY DOES IT NOT SAVE? ALWAYS COMES BACK TO THE OTHER OPTION. SAVE SAVE SAVE, STOP FORGETTING. WHAT THE ACTUAL F IS WRONG WITH THIS GARBAGE SOFTWARE? -- okay, I know thats extreme but thats how I'm feeling right now. I have been fighting this for 4 weeks now, read the documentation, searched on google, searched on bing, asked in the most useless discord of all time (some pihole/adgaurd discord thats basically a ghost town)

I apologize for my strong reaction and opinion, but after 4 weeks of trying everything, I am starting to think its not me, its you. When you click "save" it should...... SAVE THE SETTING.

Okay, now that I've got all that out, I would really appreciate if anyone has any kind of input that may lead to the resolve of my problem.

Switching Pi-hole's Interface Settings via Settings | DNS is the correct way to address this.

So you added another configuration file, and that file does not surive a reboot.
This strongly suggests that the issue lies with your file system - possibly it is in read-only mode.

That may happen for a variety of reasons, e.g. if your OS detects file system issues during boot, locking write access in an effort to prevent further corruption, or if perhaps you were using a read-only file system.

This would also explain why changes via Pi-hole's UI won't survive a reboot.

1 Like

Thank you so much for your reply. The config file I added at /etc/dnsmasq.d/something.conf DOES survive the reboot, but pihole ignores it. -- and no file system problems, but it is running in a docker. (I edited the configs inside the docker, ie: docker exec pihole bash)

Apologies for my oversight - I didn't spot that you've tagged your topic as Docker, though you do not mention it otherwise in your original post.

Docker would use a read-only filesystem by default (sort of - it employs a writable container layer that allows changes, by they will vanish if the container goes out of existence).

Did you create the recommended volume mounts for your Pi-hole container?

Please share your docker run script or docker-compose file for your Pi-hole container.

1 Like

The docker is started at boot by the system (gentoo) and I really don't know anything about docker. -- but that file I create does survive reboots, so why is the pihole ignoring it?

I am going to go see if I can thumb through the startup scripts on gentoo and find where the docker startup scripts are...

That would suggest that you've created the volumes, which would have required you to configure your Pi-hole container.

It is not the docker startup that we are looking for, but the script or file configuring your Pi-hole container.

You surely have added some configuration info when first installing Pi-hole's Docker image?
How did you do that, by editing a docker run script, a docker-compose file, or perhaps you are using some kind of administration UI tool (e.g. Portainer) to manage your Docker installation?

1 Like

I had set it up via command line, but it was a while ago. How would I go about applying changes to the docker?

router ~/docker-pi-hole # cat start_docker_pihole.sh 
#!/bin/bash

# https://github.com/pi-hole/docker-pi-hole/blob/master/README.md

PIHOLE_BASE="${PIHOLE_BASE:-$(pwd)}"
[[ -d "$PIHOLE_BASE" ]] || mkdir -p "$PIHOLE_BASE" || { echo "Couldn't create storage directory: $PIHOLE_BASE"; exit 1; }

# Note: FTLCONF_LOCAL_IPV4 should be replaced with your external ip.
docker run -d \
    --name pihole2 \
    -p 53:53/tcp -p 53:53/udp \
    -p 80:80 \
    -e TZ="America/New York" \
    -v "${PIHOLE_BASE}/etc-pihole:/etc/pihole" \
    -v "${PIHOLE_BASE}/etc-dnsmasq.d:/etc/dnsmasq.d" \
    --dns=10.42.1.1 \
    --restart=unless-stopped \
    --hostname pi.hole \
    -e VIRTUAL_HOST="pi.hole" \
    -e PROXY_LOCATION="pi.hole" \
    -e FTLCONF_LOCAL_IPV4="172.17.0.1" \
    -e DNSMASQ_LISTENING="all" \
    pihole/pihole:latest

printf 'Starting up pihole container '
for i in $(seq 1 20); do
    if [ "$(docker inspect -f "{{.State.Health.Status}}" pihole)" == "healthy" ] ; then
        printf ' OK'
        echo -e "\n$(docker logs pihole 2> /dev/null | grep 'password:') for your pi-hole: http://${IP}/admin/"
        exit 0
    else
        sleep 3
        printf '.'
    fi

    if [ $i -eq 20 ] ; then
        echo -e "\nTimed out waiting for Pi-hole start, consult your container logs for more info (\`docker logs pihole\`)"
        exit 1
    fi
done;
router ~/docker-pi-hole # 

That script configures your container for all (permit all origins).

While Pi-hole would respect UI changes to its Interface settings during the container's lifetime, that setting from the script will be reapplied on each container start, overwriting any previous UI changes.
If you want Pi-hole to use the values from information stored in its volumes instead, you'd have to stop and remove your Pi-hole container, remove that setting from your script before restarting your container.

Unrelated, but still:

This looks like a Docker internal IP.
You should point that to the IP of the machine that is hosting your dockered Pi-hole.

1 Like

Good evening! So I managed to finally get it fixed, thanks to some brainstorming from reading your responses. I edited the compose file, killed the pihole then recreated with new compose file and all is well now! (I was previously afraid to do that because I did not fully understand where it was storing the data, but when you talked about the volumes I realized it was indeed using the volumes and with some searching I realized those should survive when deleting/updating/installing so then I went ahead and did that)

Now as for that IP address, I have a funny setup due to personal vpn (not one of those "hide me" vpns, but a vpn to my remote servers), so that ip is the ip of the docker interface on the host, not inside the docker. The reason for this is because I currently run dnsmasq on the host with some very specific configuration along with bind (3rd backup on external ip for dns incase both my remote servers go down)......

Laptop dns request -> pihole (for filtering facebook/youtube/etc from children) -> dnsmasq on host (for internal network dns names) -> cisco opendns with family filtering

dnsmasq handles all DHCP requests but configured to give the pihole internal ip 172.18.0.2 (172.18.0.1 is the host interface for docker) as the DNS server to all leases.

So my situation has been resolved, and while not directly from your answers I would not have come to a conclusion this quickly, effectively or understood the situation as well without your help. Thank you so much!