Unifi & PiHole Configuration - M (2024)

Unifi & PiHole Configuration

2022-02-19

Introduction

Below are the steps needed to setup PiHole with Unifi UDM Pro.The sofware versions involved are:

  • Unifi UDM Pro: Network v6.5.55
  • Raspberry PI 4: PiHole v5.8.1

TL;DR

The main actions to note are:

  • Setup networks for devices that you require in Unifi.
  • Ensure the networks have no content filtering in Unifi.
  • Setup appropriate network/firewall rules to allow access to DNS.
  • Install and enable PiHole

Configuration

PiHole

I have a raspberry Pi 4 attached to my home network.

Unifi

I have setup 4 networks with the following CIDRs:Unifi network CIDRs

You need to setup firewall rules to control traffic on your network but in order to allow DNS traffic to your PiHole you'll need the following:

  • Rule Type: LAN in
  • Description: ALLOW ALL to DNS
  • Action: Accept
  • IPv4 Protocol: TCP and UDP

Source Settings

  • Source Type: Address/Port Group
  • IPv4 Address Group: Any
  • IPv4 Port Group: Any

Destination Settings

  • Destination Type: Address/Port Group
  • IPv4 Protocol: DNS Server -> Create a group with the IP of the DNS Server with PiHole.
  • Port Group: DNS Port -> Create a group with the port number 53.

Save those settings.

Next you'll need to set the DNS IP for all the networks that you've setup as follows:Go to each network and set the DNS IP to the DNS Server (in my case it's 192.168.1.2):

Unifi & PiHole Configuration - M (2)

Make sure that no content filtering settings have been set as this will interfere with DNS queries.Unifi & PiHole Configuration - M (3)

Save those settings.

Unifi & PiHole Configuration - M (2024)

FAQs

What is the benefit of using Pi-hole as DHCP? ›

By using Pi-hole's DHCP, you allow Pi-hole to give its dns configuration to each of your clients. This way, every request will be filtered by Pi-hole.

How to configure Pi-hole as a DHCP server? ›

In the left side menu, select the "Settings" page. In the DHCP tab, in the "DHCP Settings" block, check the "DHCP server enabled" box. Pi-hole should pre-populate the IP address range with the IP block that your router currently uses, and the router IP address with the router's current IP address.

How do you optimize a Pi-hole? ›

Optimize Pi-hole setting for benchmarking

We suggest disabling both logging and the long-term database during the benchmark run as both the log file and the database would otherwise unnecessarily grow, several hundred megabytes may be possible.

Does using Pi-hole slow down Internet? ›

The only way for Pi-hole to slow down your network is if you've set up something to route all traffic via the Pi-hole server. Pi-hole only handles DNS queries, there is no way for it to slow down the internet connection at all, it doesn't see or handle any traffic other than DNS queries.

Does Pi-hole affect network speed? ›

It blocks ads and malware at the network, instead of using extensions/add-ons for individual browsers, so you'll stop seeing ads in some of the most intrusive places, like your smart TV. Pi-hole can even improve your network's speed and reduce bandwidth.

Is Pi-hole good for security? ›

If you're serious about your personal security, running a Pi-hole adds an additional layer of isolation and reporting which will give you insight into devices you have on your network, allowing you to know more about where your devices connect to (often without you knowing) and how often they are transmitting this data ...

Can Pi-hole act as a DNS server? ›

Pi-hole includes a caching and forwarding DNS server, now known as FTL DNS . After applying the blocking lists, it forwards requests made by the clients to configured upstream DNS server(s).

Does Pi-hole need DHCP? ›

The DHCP server is an optional feature that requires additional ports. If you have another Web server already running, such as Apache, Pi-hole's Web server will not work. You can either disable the other Web server or change the port on which lighttpd listens, which allows you keep both Web servers running.

How to add local DNS entry in Pi-hole? ›

Once Pi-Hole is setup, head over to the local DNS settings under DNS Records at /admin/dns_records. php . Here you can enter a local domain name that will point to a local IP of your choice. Example, if you have a local Bookstack instance setup on 192.168.

How much memory is needed for Pi-hole? ›

Prerequisites. To deploy Pi-hole on your home network, make sure you have all of the following: A Raspberry Pi with at least 512MB of RAM (all Raspberry Pi versions satisfy this requirement) and Raspbian installed. An SD-card with at least 2GB of free space.

What is the purpose of Pi-hole? ›

The PiHole acts as a Domain Name System, logging all DNS requests and filtering the Primary Domain Request. If something found was on the blocklist information it is stopped here. The DNS request is then sent through your router and into the internet.

Where does Pi-hole set static IP? ›

Specifying a fixed Static IP for you Pi on your local network can be done in a number of ways. The preferred way is to allocate it as a reserved IP in your Router linked to the MAC address of your Pi's network interface so the Pi will be given the same IP by DHCP every time. I use a variant of this method.

How do I connect my Pi-hole to my network? ›

You install Pi-hole on your server (in this case, we're using a Raspberry Pi) and assign it a static IP address. On your router, you set the DNS primary server to the Pi-hole IP address. When a device connects to your home network, it gets the Pi-hole IP address as its main DNS server from your router.

Can I use a Raspberry Pi as a UniFi controller? ›

UniFi is a really good brand from Ubiquiti for network equipment (no sponsorship, just my feeling) in particular for home and small businesses. It comes with a controller to manage the whole network. This controller can be deployed on a small computer like raspberry Pi.

Can UniFi controller run on Raspberry Pi? ›

For this first step, we will download the latest available version of MongoDB 4.4 to our Pi. We are installing 4.4 as this is currently the only supported release for the UniFi Controller that is compatible with the Raspberry Pi.

Top Articles
Latest Posts
Article information

Author: Greg Kuvalis

Last Updated:

Views: 5999

Rating: 4.4 / 5 (75 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Greg Kuvalis

Birthday: 1996-12-20

Address: 53157 Trantow Inlet, Townemouth, FL 92564-0267

Phone: +68218650356656

Job: IT Representative

Hobby: Knitting, Amateur radio, Skiing, Running, Mountain biking, Slacklining, Electronics

Introduction: My name is Greg Kuvalis, I am a witty, spotless, beautiful, charming, delightful, thankful, beautiful person who loves writing and wants to share my knowledge and understanding with you.