PiHole failure

  • I just set up the pihole myself on omv. Checked the tutorial, but did not like it due to the way he sets it up and for changing the dns in OMV.


    Here is what I did:

    First: create a macvlan on the hpst: 192.168.109.0/24 is my network, ens192 is the ethernet pot on my omv, gateway is 192.168.109.1 and I only want docker to use IPs 192.168.109.89 to 192.168.109.94 for internal network reasons.

    Code
    docker network create -d macvlan -o parent=ens192  --subnet 192.168.109.0/24  --gateway 192.168.109.1 --ip-range 192.168.109.89/29 macvlan0


    This is the docker-compose.yml

    If you use portainer, just kopy the docker-compose.yml file inside a portainer stack, make the adjustments and here you go.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • only a small info, on latest releases pihole do not recomend to use 127.0.0.1 as primary DNS server , in fact a warnning appear on webGUI to suggest you to change it, so use 1.1.1.1 as primary DNS server is best today


  • Thank you so much for this. I finally had a few minutes to give it a try and it is complaining when I try to create the macvlan.


    Code
    docker network create -d macvlan -o parent=enp6s0f1  --subnet 192.168.1.0/24  --gateway 192.168.1.1 --ip-range 192.168.1.89/29 macvlan0


    Zitat

    Error response from daemon: failed to allocate gateway (192.168.1.1): Address al ready in use


    Could this be a result of already having a maclan? I have one from one of the tutorials.



  • So I went ahead and used the same maclan that I already had (pihole_net on my side).



    Unfortunately a very similar error as my previous attempts


  • Do the change as soma suggested (seperate the two folders on your /srv/ disk) and additionally give it a new folder for dnsmasq, so it can start clean. Mind the indent when replacing the lines on your docker-compose.yml


    Code
    - '/srv/dev-disk-by-label-Docker/AppData/Pi-hole3/etc-pihole:/etc/pihole/'       # I have the data inside the same folder as docker-compose.yml ADJUST HERE
    - '/srv/dev-disk-by-label-Docker/AppData/Pi-hole3/etc-dnsmask:/etc/dnsmasq.d/' # I have the data inside the same folder as docker-compose.yml ADJUST HERE

    If this does not help. give me the output of:

    ls -la /srv/dev-disk-by-label-Docker/AppData
    ls -la /srv/dev-disk-by-label-Docker/AppData/Pi-hole3

    ls -la  srv/dev-disk-by-label-Docker/AppData/Pi-hole3/etc-dnsmask

    ls -la srv/dev-disk-by-label-Docker/AppData/Pi-hole3/etc-pihole

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • Thank you again for your suggestion. Unfortunately the result is the same:



    I adjusted the folders based on the structures that I used in this test


    Code
    root@HAL:/srv/dev-disk-by-label-Docker/Docker/containers# ls -la /srv/dev-disk-by-label-Docker/AppData/Pi-holeTESTDNS/DNSMasq
    total 24
    drwxr-sr-x+ 2 root root 4096 Jan 25 17:45 .
    drwxr-sr-x+ 3 root root 4096 Jan 25 14:41 ..
    -rw-r--r--  1 root root 1339 Jan 25 17:45 01-pihole.conf
    -rw-r--r--  1 root root 2190 Jan 25 17:45 06-rfc6761.conf
    root@HAL:/srv/dev-disk-by-label-Docker/Docker/containers#
  • I do not know if that is the reason, but to me the permissions on you folders in AppData look strange:

    How did you create the directory: /srv/dev-disk-by-label-Docker/AppData?

    Code
    drwxrwsrwx+  3 openmediavault-webgui openmediavault-config 4096 Jan 23 13:40 Pi-hole
    drwxrwsrwx+  3 openmediavault-webgui openmediavault-config 4096 Jan 24 19:20 Pihole
    drwxr-sr-x+  3 openmediavault-webgui openmediavault-config 4096 Jan 25 14:30 Pi-hole3
    drwxr-sr-x+  2 openmediavault-webgui openmediavault-config 4096 Jan 25 17:41 Pi-holeTEST
    drwxr-sr-x+  2 openmediavault-webgui openmediavault-config 4096 Jan 25 14:37 Pi-hole_TEST1
    drwxr-sr-x+  3 root                  root                  4096 Jan 25 14:36 Pi-holeTEST2
    drwxr-sr-x+  3 root                  root                  4096 Jan 25 14:41 Pi-holeTESTDNS


    These all have ACLs an SGID bit set.


    Just create an ordinary directory owned by root and 755 permissions, no s, no + in the permissions.

    as root:

    Code
    mkdir -p /srv/dev-disk-by-label-Docker/AppData/Pi-hole-new/etc-pihole
    mkdir -p /srv/dev-disk-by-label-Docker/AppData/Pi-hole-new/etc-dnsmask
    chmod -R 755 /srv/dev-disk-by-label-Docker/AppData/Pi-hole-new
    chmod -R g-s /srv/dev-disk-by-label-Docker/AppData/Pi-hole-new
    setfacl -R -b /srv/dev-disk-by-label-Docker/AppData/Pi-hole-new

    This tries to reset any permissions and ACLs back to normal


    Post the outout of ls -la /srv/dev-disk-by-label-Docker/AppData/Pi-hole-new


    Adjust the stack to the new directories (section volumes, left side) and retry


    If this does not help, follow @raulfg3's advice :(

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • For me, it still makes me confuse about all that macvlan stuff.

    Haven't read exactly what it is for.


    What I use with adguard (and I know that works with Pi-hole) is to set the port 53 with the LAN IP from the host:



    Since the ports will be binded to the host IP:PORT, it won't spit any errors that it's already in use.


    What happens is that instead of seeing hostnames on the GUI, it will show IPs.:


    Maybe this can be changed to hostnames but didn't give too much importance to it.

    Don't really care that it shows IPs since I know to whom they belong.

    Only clients using the adguard as BLOCKER are the phone's and Laptops (configured on the network definitions to point the DNS to 192.168.1.86)

    The OMV server(s) use the DNS from the router.


    Just my 50cents...


  • Thanks you again! Unless something jumps out I'll close this thread after this attempt. Last night I stood up a raspberry pi running pihole just so I have something. I was not aware of adguard - I'll give that a look next.


    Ok, I followed your excellent directions and came up with one of my previous errors. I made AppData several years ago - it was probably made through windows as it was a shared folder.


    Code
     -1 }">sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
     -1 }">sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
     -1 }">sudo: fatal error, unable to load plugins
     -1 }">::: Testing pihole-FTL DNS: [cont-init.d] 20-start.sh: exited 1.
     -1 }">[cont-finish.d] executing container finish scripts...
     -1 }">[cont-finish.d] done.
     -1 }">[s6-finish] waiting for services.
     -1 }">[s6-finish] sending all processes the TERM signal.
     -1 }">[s6-finish] sending all processes the KILL signal and exiting.

    I saw that others had this issue with pihole. I pulled a new image - no luck. I then ran this from within the container's path (it was a solution in pihole's github):

    Zitat

    docker stop pihole3; docker start pihole3; docker exec -it pihole3 chown 0:0 /usr/lib/sudo/sudoers.so; docker exec -it pihole3 chmod 0644 /usr/lib/sudo/sudoers.so

    So now I am back at this error


    Code
     -1 }">2022-01-26T22:42:31.834799775Z sudo: /etc/sudoers is world writable
     -1 }">2022-01-26T22:42:31.834811730Z sudo: no valid sudoers sources found, quitting
     -1 }">2022-01-26T22:42:31.834819476Z sudo: unable to initialize policy plugin

    So... I've revisited all of the errors from the past week.

  • Only the path shold have been /etc/sudoers


    Code
    docker stop pihole3
    docker start pihole3;
    docker exec pihole -it ls -la /etc/sudoers
    docker exec -it pihole3 chown 0:0 /etc/sudoers
    docker exec -it pihole3 chmod 0644 /etc/sudoers
    docker exec pihole -it ls -la /etc/sudoers


    Looks like a broken image or etc/sudoers is a link to you volume.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • But I see, you are still not following the advice, to have two different folders mounted into pihole, you still insist on having one folder inside the other.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!