How to add pi.hole to /etc/hosts

    • How to add pi.hole to /etc/hosts

      Well first I need to describe my actual config:

      I have installed pihole on a docker ( MacVLAN to use port 80; I use 192.168.1.3 as IP for this docker) that works very well for all the LAN and all PC and devices.

      I configure pihole not only as a DNS Server, I configure as DHCP server too.

      My NAS have IP 192.168.1.4 255.255.255.0 and use as DNS Server 8.8.8.8 (configured in OMV WebGUI), this is because if use 192.168.1.3 that is the IP of my pihole DNS Server I have some errors on OMV boot (probably due OMV need to resolve DNS and docker still is not ready).

      So actual config works well except that my NAS can't resolve pi.hole or pihole because I use google DNS in OMV

      I want to add 192.168.1.3 pi.hole to /etc/hosts but file says:

      Source Code

      1. # This configuration file is auto-generated.
      2. # WARNING: Do not edit this file, your changes will be lost.
      3. 127.0.0.1 localhost
      4. 127.0.1.1 PDNS.local PDNS
      5. # The following lines are desirable for IPv6 capable hosts
      6. ::1 ip6-localhost ip6-loopback
      7. fe00::0 ip6-localnet
      8. ff00::0 ip6-mcastprefix
      9. ff02::1 ip6-allnodes
      10. ff02::2 ip6-allrouters
      11. ff02::3 ip6-allhosts
      12. 192.168.1.4 PDNS.local PDNS
      Display All
      So my question is:

      how to add line 192.168.1.3 pi.hole so my NAS (PDNS) know to resolve pihole address without lose on reboots / updates?.
      OMV 4.1.11 x64 on a HP T510, 16GB CF as Boot Disk & 32GB SSD 2,5" disk for Data, 4 GB RAM, CPU VIA EDEN X2 U4200 is x64 at 1GHz

      Post: HPT510 SlimNAS ; HOWTO Install Pi-Hole ; HOWTO install MLDonkey ; HOHTO Install ZFS-Plugin ; OMV_OldGUI ; ShellinaBOX ;
      Dockers: MLDonkey ; PiHole ; weTTY
      Videos: @TechnoDadLife
    • raulfg3 wrote:

      how to add line 192.168.1.3 pi.hole so my NAS (PDNS) know to resolve pihole address without lose on reboots / updates?.
      Isn't this 192.168.1.4 PDNS.local PDNS auto generated from the network in OMV's GUI.

      To do what you want to do I think you would have to change the way pi-hole is set up using the MacVlan, I found this on Docker I tried setting the DHCP on Pi-Hole and it just didn't work for me, I now use the dnsmasq plugin and point the DNS server to Pi-Hole.
      Raid is not a backup! Would you go skydiving without a parachute?
    • geaves wrote:

      Isn't this 192.168.1.4 PDNS.local PDNS auto generated from the network in OMV's GUI.
      NO, PDNS is the name of my NAS and is well resolved, the only not resolved is pi.hole if I try to use from PDNS if I try to use from a normal PC works fine ( because PC are DHCP and use 192.168.1.3 as DNS resolver).

      So my question is: how to add line 192.168.1.3 pi.hole PIHOLE so my NAS (PDNS) know to resolve pihole address without lose on reboots / updates?
      OMV 4.1.11 x64 on a HP T510, 16GB CF as Boot Disk & 32GB SSD 2,5" disk for Data, 4 GB RAM, CPU VIA EDEN X2 U4200 is x64 at 1GHz

      Post: HPT510 SlimNAS ; HOWTO Install Pi-Hole ; HOWTO install MLDonkey ; HOHTO Install ZFS-Plugin ; OMV_OldGUI ; ShellinaBOX ;
      Dockers: MLDonkey ; PiHole ; weTTY
      Videos: @TechnoDadLife
    • raulfg3 wrote:

      NO, PDNS is the name of my NAS and is well resolved
      I understand that, but that entry is made/added automatically by OMV using the information in your Network>>>Interfaces. That's why I referenced the link to Docker re the Macvlan, OMV is not aware of Pi-Hole's name or ip address, therefore Pi-Hole will not appear in the hosts file. I'm not very good at explaining, but put as a reference you need a symlink that will create an entry in the hosts file.
      So my understanding would be is that the MacVlan would need to be a MacVlan-Bridge which might create the entry in the hosts file.
      Raid is not a backup! Would you go skydiving without a parachute?
    • Users Online 1

      1 Guest