Installing Pi hole on Proxmox and using OPNsense Unbound DNS Upstream

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

Комментарии • 93

  • @Lordniksidor
    @Lordniksidor 3 месяца назад +2

    Really appreciate your lack of bs & straight forward explanations 👍🏻

    • @homenetworkguy
      @homenetworkguy  3 месяца назад +1

      Thanks! I try to be straightforward in my explanations. It can be difficult to stay on topic sometimes (I suppose I should take the time to write up a script to help make it better).

  • @burg0110
    @burg0110 Месяц назад +1

    Thank you very much for your videos. I've been planning a do-over and my last question before commencing the build was DNS across multiple networks. And of course you covered it. I've learnt a lot.

  • @ashfordj81
    @ashfordj81 2 месяца назад

    Thank you very much for these guides. Your setup is so close to my use case (just running OPNSense baremetal) that it's been extremely helpful!

    • @homenetworkguy
      @homenetworkguy  2 месяца назад

      Awesome that it closely matches your use case so that this guide is helpful!

  • @Glasairmell
    @Glasairmell 7 месяцев назад +2

    Have become a fan of yours. Keep up the great work. You are making a difference. Thank you.

    • @homenetworkguy
      @homenetworkguy  7 месяцев назад

      Thanks for the encouragement! There is a lot more I want to do but I have to pace it out since I don’t do this full time and also to avoid burnout.

    • @Glasairmell
      @Glasairmell 7 месяцев назад

      Go slow to go fast.@@homenetworkguy

  • @JeffGeerling
    @JeffGeerling Год назад +10

    Umm... how did you find this query in my search history and then make a video on it??

    • @homenetworkguy
      @homenetworkguy  Год назад +3

      Haha! I just had this feeling that Jeff Geerling needed this video! Actually I haven’t covered Pi-hole in a while so I thought I’d do a video on how I would implement it on my network should I use it again. I know Pi-hole is a beloved software among homelabbers so I definitely wanted to cover it. I’ve been building out a separate lab environment (both physical and virtualized hardware) where it’s becoming much easier for me to try out new things without screwing up my main network for my family. You know, I don’t want support tickets for that!

    • @aldi3556
      @aldi3556 Год назад +1

      Hi, I’m dipping my toes into OpnSense and this video was something I was hoping to find so thanks a lot for this, I’ll love to see the same thing done with Adguard home, maybe an idea for a future video! 😅 Love the video content after following the different posts on your website.

    • @homenetworkguy
      @homenetworkguy  Год назад +2

      Thanks! Yeah, that is a possibility! I know a lot of people like using AdGuard Home as well.

  • @anthonyyu2722
    @anthonyyu2722 4 месяца назад

    Very helpful! Just configured my Proxmox/OPNsense/Pi-hole combo with your easy to follow steps and I'm good to go. Will try the multi-network config in the future.

    • @homenetworkguy
      @homenetworkguy  4 месяца назад +1

      Awesome that it worked well for you!

  • @henderstech
    @henderstech 4 месяца назад

    Thanks for this video. It is much appreciated. I have switched to opn sense because I was able to get ahold of a nice 4 core device with QAT and 10gbe spf+ and rj45 for under 90$

    • @homenetworkguy
      @homenetworkguy  4 месяца назад

      You're welcome! Nice! I am curious if a CPU with QAT will make a difference in OPNsense (perhaps for VPNs?).

  • @3dmakerzone75
    @3dmakerzone75 Год назад

    This is something on my list so I was happy to see a video on it! I don’t run proxmox or containers but I do have a RPi4 that I could use.

    • @homenetworkguy
      @homenetworkguy  Год назад +1

      Glad you were happy to see it! You can certainly run Pi-hole on anything but I thought it would be interesting to do it in a container on Proxmox without using Docker. I have older written guides on my website setting it up using Portainer in Docker on a Raspberry Pi but those are out of date.

  • @JosephARomo
    @JosephARomo 8 месяцев назад

    Thanks so much! I followed this very closely and got it to work using pfsense.

    • @homenetworkguy
      @homenetworkguy  8 месяцев назад

      You’re welcome! Glad you got it working!

  • @cnkosm6536
    @cnkosm6536 5 месяцев назад +1

    Hey my friend, thanks again... I've been following your network advices and everything work great!
    In my Proxmox setup I have 3 ethernet ports, 1 onboard and 2 on a PCIe card. The ones on the card are assigned to OPNsense VM with PCI passthrough, so I guess I can't use the LAN port for Pihole LXC. In this case, would it be better to just use Adguard inside OPNsense OR rebuild the OPNsense VM with only the WAN port as PCI passthrough and LAN as virtual bridge? Using the onboard virtual NIC (which is used by Proxmox itself, Home Assistant VM, etc) probably wouldn't be efficient/optimal, right?...

    • @homenetworkguy
      @homenetworkguy  5 месяцев назад +2

      Nice! Since you’re using Proxmox, you could set up AdGuard on Proxmox separately from OPNsense if you want assuming you are ok having it on the same interface as your Proxmox management interface. Otherwise you can do it in OPNsense if you want to use the community repository. I personally would run it on Proxmox so I wouldn’t have to use the community repo (sometimes issues can be had during upgrades). Also if you’re using Pi-hole you don’t need AdGuard and vice versa. I wouldn’t use both.

  • @thecameratherapychannel
    @thecameratherapychannel 8 месяцев назад

    Thank you so much for your time and dedication!!!

  • @usmc7210
    @usmc7210 Месяц назад

    Thanks for doing a Pi-Hole one with Proxmox. Been following the whole Proxmox journery with you as I'm transitioning to a Vault and all the goes along with this. Can you please advise on the whole Pi-hole recursive setup using Unbound. Are their any other things you should do that are not covered in this video?

    • @homenetworkguy
      @homenetworkguy  Месяц назад +1

      If you have all your network clients use Pi-hole and then use Unbound DNS in OPNsense as the upstream DNS server for Pi-hole, you will be using the recursive DNS features of Unbound in OPNsense.
      If you are only using Pi-hole as your DNS server and not using Unbound in OPNsense, you can configure Pi-hole to do recursive lookups but it takes some configuration work: docs.pi-hole.net/guides/dns/unbound/

  • @AmirHomayounSadoughi
    @AmirHomayounSadoughi Год назад

    Nice video. I switched to adguard home a while ago, mostly because I want my dns server to run on my OpnSense box. I basically want to be able to bring other things down and still have internet. I am using it with unbound, but dont know why. Same with your setup, you probably can put in the upstseam DNS resolver in pi-hole and get rid of unbound. In my case, AGH supports DoH and DoT, so really not sure why I have unbound! :)
    You probably know this and skipped it to keep the video short, but maybe create an alias for the DNS server. A rule to forward all queries on port 53 and a rule to block queries to known public DNS servers is nice (as some devices ignore the advertised DNS server).
    Thanks for the video again, it was done well!

    • @homenetworkguy
      @homenetworkguy  Год назад +1

      Thanks! I don’t actually use Pi-hole AdGuard currently. Just Zenarmor and CrowdSec so I don’t have to check several places if something is blocked (at one point I had to check Zenarmor, Pi-hold, and Suricata- now I just check Zenarmor).
      I was simply doing this video as a demonstration for Pi-hole so it’s not a representation of my own network). I also was trying to stick to a single topic. Haha. I thought I mentioned you can create an alias for Pi-hole but I just used the IP so you can see it clearly in the example.
      I personally like to keep Unbound DNS in the mix because of local hostname resolution (yes if you make Pi-hole handle DHCP as well, you can have that). I like to manage my static IP reservations in OPNsense since it’s centralized so it’s easy to register those static IP hostnames in Unbound. Also I can configure Unbound to use DoT (which is what I do on my network).
      This is one of those areas where you can do it a number of ways. I just pick one way and did it as an example. 🙂

    • @AmirHomayounSadoughi
      @AmirHomayounSadoughi Год назад

      I might've missed it. Thanks.
      I never set up Zenarmor. Not sure if you have a video about it, but it's a reminder for me to take a look at it!

    • @firefon326
      @firefon326 11 месяцев назад

      ​@@homenetworkguyjust getting started on migrating from PF since to OPN sense. Was planning on doing zen armor anyway, are you saying that takes the place of pie hole/ ad guard?

    • @homenetworkguy
      @homenetworkguy  11 месяцев назад

      @@firefon326 You can block ads/trackers/etc via DNS blocks with Zenarmor in addition to the other security features it ships with. You can still do blocklists via the built-in Unbound DNS if you like (there is a reports page similar to Pi-hole so you can still have a web interface).
      There may be some specific features Pi-hole or AdGuard have that Zenarmor doesn't but overall, I love having one product handle those sorts of tasks. It has lots of graphs and charts to look at the data too.
      I also use CrowdSec which uses crowd-sourced blocklists. CrowdSec doesn't require extra maintenance so it's good just to have as an extra layer of protection (since it can help protect the OPNsense web interface itself as well as the SSH service running on OPNsense so it does more than just block malicious IPs for your entire network).

    • @Montagic
      @Montagic 9 месяцев назад

      @@homenetworkguydo you have any videos on this setup? I’d love to see something about this

  • @tarekt.4008
    @tarekt.4008 4 месяца назад

    Greetings from Germany :) I used your site a lot last year to set up my Opnsense, and it's working great. Now I would like to go to the next step and build my own home lab.
    Can you tell me if the Opnsense instance, shown in this video, is running on the Proxmox server that you installed Pi Hole on, or is it a separate machine? Thanks for your great work :)

    • @homenetworkguy
      @homenetworkguy  4 месяца назад +1

      Thanks! Appreciate it. I have OPNsense installed bare metal on my machine for my main network.
      However for this demonstration everything was virtualized (the beauty of virtualization). I was using Pi-hole in a container connected to a virtualized OPNsense using a bridge interface that has no physical interface assigned (meaning the bridge is a purely virtual and can be used to put VMs and CTs on the same virtual networks).
      I don’t currently use Pi-hole on my network which is why I simulated an entire example network with Pi-hole deployed.
      You might like my upcoming video about virtualizing OPNsense on Proxmox and how you could configure the network interfaces.

    • @tarekt.4008
      @tarekt.4008 4 месяца назад

      @@homenetworkguy thanks. I will look into it. I plan to have Opnsense and Proxmox on different machines. The Proxmox (with Docker containers) will be connected via a switch to Opnsense on a specific VLAN. For remote access, I thinking of using Tailcale. For me, this is all new territory, so channels like yours are absolutely awesome!

  • @Decebal825
    @Decebal825 8 месяцев назад +1

    am a bit confused i though that in Opnsense you were going to setup the unbound

    • @homenetworkguy
      @homenetworkguy  8 месяцев назад +1

      What I configured is DHCP for the various networks to use the Pi-hole as the DNS server for all of the clients on the networks, but then Pi-hole itself is configured to use Unbound DNS on OPNsense as its upstream DNS provider. Unbound DNS can be configured the same way as you normally would for your network (leave at the default settings to use your ISP DNS servers on the WAN interface or you can use DNS over TLS, etc). So basically the flow of DNS lookups is the following: client device > Pi-hole DNS > Unbound DNS > External DNS server (ISP DNS, Cloudflare, Quad9, Google, or other DNS server you configured).

  • @direnm100
    @direnm100 9 месяцев назад

    Thank you. Very helpful video.

  • @jstjohn11
    @jstjohn11 Год назад

    Very handy, thank you!

  • @jeytis72
    @jeytis72 Год назад

    Very clear. Thanks

  • @ahmad1980595
    @ahmad1980595 3 месяца назад

    thank ....that was helpful

  • @Tntdruid
    @Tntdruid 2 месяца назад +1

    I'm using Unbound as a recursive DNS server, no need to send dns to the internet.

    • @homenetworkguy
      @homenetworkguy  2 месяца назад

      Recursive resolver is the default behavior of Unbound, but what do you mean it doesn’t send DNS to the Internet? A recursive resolver reaches out to the root DNS servers if the DNS lookup is not cached locally.

  • @CyrilPinto-q6s
    @CyrilPinto-q6s Месяц назад

    Hi; for some reason I'm not able to find your video about hte OPNSense DNS Confusion (i.e. the multitude of options). Wanted to ask; that if I were to setup Pi-Hole as DNS using Services -> DHCP -> Lan/Vlan and DNS Servers, the assumption here is that this will be the DNS that will be used. Question: If I were to add a few Static IPs (using the Static Mapping Option), and then add a "different" DNS Server, would those Static IPs then use this "different" DNS, or will it use the DNS defined under Services/DHCP/Interface.

    • @homenetworkguy
      @homenetworkguy  Месяц назад

      I made that video private cause I need to redo it to make it more accurate like my website. Although someone mentioned to me I may need to correct a few things on there too. So many knobs and dials for DNS it’s hard to keep it straight. Haha.
      I haven’t tried it but I’m assuming the settings in the static mappings will take precedent over the interface DNS setting.

  • @cyrilpinto418
    @cyrilpinto418 3 месяца назад

    Really appreciate everything you do; small question is presently I have Unbound DoT setup to use Clean Browsing DNS. If I go towards Pihole route / method, would I have to disable any / all settings in Unbound?

    • @homenetworkguy
      @homenetworkguy  3 месяца назад +1

      If you configure DNS such that your DHCP client devices receive the Pi-hole DNS server IP as the DNS server and then configure Pi-hole to use Unbound DNS as its upstream DNS server, you will be able to leave your Unbound DNS configuration as it is.
      TLDR;: client > Pi-hole DNS > Unbound DNS > Clean Browsing DNS.

    • @cyrilpinto418
      @cyrilpinto418 3 месяца назад

      @@homenetworkguy once again thank you for all that you!!!

  • @gillt1
    @gillt1 2 месяца назад

    Not sure if you still see these comments, but i hope so. I have a spare laptop with Proxmox running bare metal. One VM with Home Assistant and now ran a script for PiHole and am trying to follow your guide. PiHole running but im at 9:27 and you jump to configure Unbound.. but.. when did you set that up? I dont think i have it or know how to access it and didnt see that part of your set up?

    • @homenetworkguy
      @homenetworkguy  2 месяца назад +1

      This guide assumes you are running OPNsense which uses Unbound DNS. If you’re using a different router, you would need to configure it to hand out the Pi-hole DNS server IP address of Pi-hole (assuming your router is handing out DHCP leases to all of your clients on your network). It’s up to you if you want to forward the DNS requests from Pi-hole to your local router or not. When I used Pi-hole, I liked to do that because I could still have local name resolution for all of the clients on my network.

    • @gillt1
      @gillt1 2 месяца назад

      @@homenetworkguy ok thanks..I e found another source for setting Unbound on my Piehole VM to catch up here ...thanks!

  • @demorez5
    @demorez5 5 месяцев назад

    i am bit confused by this video. what upstream DNS servers are being used to actually resolve domain names? also which DNS overrides apply in this setup? the ones set in PiHole or in OPNsense under Unbound overrides?

    • @homenetworkguy
      @homenetworkguy  5 месяцев назад +1

      Pi-hole is using Unbound DNS on OPNsense as the upstream DNS and Unbound DNS is using whatever you have configured for Unbound DNS (the default settings of Unbound is a recursive resolver but you can configure it to use alternate DNS servers like Cloudflare and also use DNS over TLS, etc).

  • @misterust
    @misterust 2 месяца назад

    I have a setup where PiHole+Unbound are running inside a Proxmox LXC container and have dual virtual NICs for each of my Home and IoT VLANs. PiHole listens on all interfaces so I can respond to IoT DNS queries without a need for additional firewall rules. Working through one issue - I'd like to have Unbound respond with different resolution based on the source IP, so that if a device on the IoT network asks for my reverse proxy it gets back the reverse proxy's IoT IP.. But with unbound set to the upstream DNS provider of PiHole it just sees all requests coming in on localhost. Any thoughts on approaches I could take to resolve this?

    • @homenetworkguy
      @homenetworkguy  2 месяца назад +1

      That’s a good idea about using multiple interfaces. I didn’t think about that at the time because I was mimicking my old Raspberry Pi setup long ago which only had 1 physical interface so I had to do it that way to share it across networks. I should do an updated version of this video. Haha.
      As for what you’re asking, it sounds like you could make use of split DNS using Unbound DNS overrides. It allows your local DNS requests to use the local IP address of your reverse proxy instead of using your external IP address. Some people like to use NAT loopback but I prefer Unbound DNS overrides.

  • @mixedd69
    @mixedd69 4 месяца назад

    I assume mostly same steps are aplicable to Adguard Home also, right?

    • @homenetworkguy
      @homenetworkguy  4 месяца назад +1

      Essentially you can follow similar steps if you’re wanting to use any other local DNS server besides Unbound DNS in OPNsense.

  • @gizmotronbiz
    @gizmotronbiz Год назад

    I managed to get this to work only yesterday after several weeks/attempts, then this video came out (timing). What is the listen port in Unbound set to ? I set mine to 5335 and in pihole set upstream address with #5335 on the end. is this necessary?

    • @homenetworkguy
      @homenetworkguy  Год назад +1

      Everything can be set to the default port of 53 because Pi-hole is running on a separate container on Proxmox so it has it own IP address. There’s no need to change ports since they’re not running on the same bare metal system (even if you are virtualizing OPNsense on the same Proxmox server, you don’t need to change the default port).

  • @zyghom
    @zyghom 7 месяцев назад

    I find setting up IP per VM or per CT on proxmox (or for bare metal hosts on them) rather than in opnsense - if my opnsense goes down there would be a mess (even for the moment of bringing another router) - all servers must have static IP the moment they start, right?

    • @homenetworkguy
      @homenetworkguy  7 месяцев назад +1

      You don't technically need static IPs if you are using hostnames, but for firewall rules, I find it best to use static IPs. You can decide if it's better to have it all managed in one place (OPNsense) or set up the IP address on every single server, container, VM, etc. I find it much more convenient to assign all the static IPs in OPNsense, but you are correct that if you swap out the router and do not have all the static IP mappings, it could be problem. The problem may not happen right away depending on how quick the DHCP leases are set to expire.
      I also want to mention that there are a few places where I do set static IPs on the devices themselves: network switch interfaces, and my server management interfaces in Proxmox, TrueNAS, etc. I've heard it recommended that you should manually assign IPs on the device if it's core network infrastructure but for other devices, static DHCP reservations work well.
      I keep a backup of my OPNsense configuration so if I move to new hardware, I have all of the static DHCP reservations and all my other settings so it's easy to migrate to new hardware without causing a lot of problems.

    • @zyghom
      @zyghom 7 месяцев назад

      @@homenetworkguy Perfect. Of course for bare metal servers I set static IP on them, i.e. TrueNAS, Proxmox, even spare Pi-hole on Raspberry.

  • @TismoGaming
    @TismoGaming Год назад

    This video came at the perfect timing. In the firewall rule for iot, you have the default rule to allow access to dns on 53. Does protocol matter whether it’s tcp/upd or can it just be upd?
    Also, what would a rule be like if I wanted to block external dns access?

    • @homenetworkguy
      @homenetworkguy  Год назад +2

      Typically DNS just uses UDP but I allow both TCP/UDP. Don’t think it’s a problem to do so.
      You could add a block rule that has the destination inverted and use the Pi-hole IP address (or firewall alias for Pi-hole) as the destination so it blocks any DNS server that’s not Pi-hole.
      You could always redirect DNS lookups to Pi-hole (if it’s unencrypted). That’s a topic I will cover at some point.

  • @Glasairmell
    @Glasairmell 6 месяцев назад

    I did an "ip address" in cmd line of Pi-hole container to get ipv6 address of it however Opnsense said invalid. Do you place ipv6 address in ISC DHCPv6 services for your pihole?

    • @homenetworkguy
      @homenetworkguy  6 месяцев назад +2

      If you’re going to be using IPv6 for Pi-hole DNS, you’d definitely want a static IPv6 address (at least the second half of the IP address because you can make use of dynamic IPv6 aliases in OPNsense if you are using dynamic IPv6 addresses provided by your ISP). Don’t use “fe80” IPv6 addresses because they’re intended for link-local connections so wouldn’t work if you want to allow access across your networks.
      I haven’t tried using IPv6 with Pi-hole. I use IPv6 minimally in my network (mostly only allow external IPv6 connections rather than using it for any of my local servers). Keeps things a bit more simple to deal with (especially since my ISP uses dynamic IPv6 addresses).

    • @Glasairmell
      @Glasairmell 6 месяцев назад

      Consistently prompt and concise reply. Much appreciated.@@homenetworkguy

  • @FloridaInvestor
    @FloridaInvestor 8 месяцев назад

    How do i keep one laptop selarate on pi hole so it wont get anything blocked?

    • @homenetworkguy
      @homenetworkguy  8 месяцев назад

      Pi-hole doesn't have settings to allow you to whitelist a device on your network (but you can create groups and assign clients to groups which have whitelists/blacklists of domain names). So the easiest way to have a device not have anything blocked is simply ensure that it does not use Pi-hole as the DNS server. That would allow the device to bypass the Pi-hole filtering.

  • @keylanoslokj1806
    @keylanoslokj1806 10 месяцев назад

    Home security with 200 euros. What router/firewall you recommend?

    • @homenetworkguy
      @homenetworkguy  10 месяцев назад +1

      You might find some mini-PCs with 4 2.5GbE interfaces with a N100 CPU off of AliExpress for around that price. You might have to get less RAM and storage capacity to meet that budget but might be doable.

  • @RupertoCamarena
    @RupertoCamarena 9 месяцев назад

    Has you openvpn client like cyberghost or nordvpn already comfigured? Could you explain that? Thanks in Advanced

    • @homenetworkguy
      @homenetworkguy  9 месяцев назад

      I don't currently use any external VPN providers but I have been wanting to write up guides for a while now because I know a lot of users like to use them to protect their privacy or to get around regional restrictions for certain content.

  • @mariotorres8910
    @mariotorres8910 17 дней назад

    5:18 okay... well I guess I have to go setup up opnsense in another video. Kind of a jarring transition

    • @homenetworkguy
      @homenetworkguy  17 дней назад +1

      It shouldn’t be too jarring since this guide is specific to those who already use OPNsense on the network but want to use Pi-hole on Proxmox (I show what you need to change in a default/base installation of OPNsense). This video would be another 30 minutes longer if I showed how to set up OPNsense too. Trying to find the perfect balance is tricky because everyone has varying amounts of experience and preferences.

  • @jeytis72
    @jeytis72 Год назад

    By the way, Could you please make a video about mDNS between devices running in different subnets? Thanks

    • @homenetworkguy
      @homenetworkguy  Год назад +1

      I could do that. I use the MDNS plugin to broadcast my printer across a couple of my networks. I think I tried it with some Apple devices (and also an HDHomeRun box) ,and it didn’t work so well. I don’t know if that plugin in OPNsense handles all types of MDNS. I haven’t explored this area as much as others so results may vary depending on the devices you are using. To make things easier on my network, I put all my media streaming/IoT devices on the same network so I don’t need MDNS other than for my printer.

    • @steveinoz1
      @steveinoz1 4 месяца назад

      Remember that the MDNS plugin for OPNsense has a maximum of 4 devices requirement/limitation.

  • @gg-gn3re
    @gg-gn3re 10 месяцев назад

    funny enough, I went to purge a package and it ran out of memory with 256 so I set it to 512 instead... otherwise the system normally uses like 40mb lol

    • @homenetworkguy
      @homenetworkguy  10 месяцев назад

      Yeah you don’t need much resources but it’s always good to set it slightly higher than the normal usage in case resource usage surges doing certain tasks in the container/VM.

  • @user-ci3pc8br7l
    @user-ci3pc8br7l 11 месяцев назад

    Hi can you make video tutorial. On how to block facebook app in phone using OPNsense.

    • @homenetworkguy
      @homenetworkguy  11 месяцев назад

      I could but the best way to block a particular app/domain is to block it via DNS rather than firewall rules.