pihole multi VLAN setup

have multiple vlans? how to configure pi-hole to properly return the device name in this sort of setup

November 06, 2018

Earlier this week I posted how to setup a Pi-hole on your network. I discovered a problem with its local network name resolving. I have a more advanced home network. I have 3 separate virtual local networks (VLAN).

  1. Guests - 30
  2. Data - 10
  3. IoT - 20

One of the things I noticed when reviewing the Pi-hole query logs was that it had the devices IP address and didn't list the devices name. This wasn't going to work for me. I have over 50 devices on my network. I really wanted to know which of my devices were talking to the network. I did some research and found the following solution to work.

Steps to setup the VLANs

You need to follow these steps to tell the Pi-hole which VLAN to look up the devices name.

  1. Remote into the Raspberry Pi
  2. Navigate to the location /etc/dnsmasq.d
  3. Add a new text file 20-customdns.conf
  4. Edit the 20-customdns.conf file to look something like this
    server=/data/10.10.10.1
    server=/local/10.10.99.1
    server=/guests/10.10.30.1
    server=/iot/10.10.20.1
    server=/20.10.10.in-addr.arpa/10.10.20.1
    server=/30.10.10.in-addr.arpa/10.10.30.1
    server=/10.10.10.in-addr.arpa/10.10.10.1
    
  5. Restart the Pi-hole

The Pi-hole only takes a few seconds to reboot. Once it's restarted, you will start seeing the names resolve. The Pi-hole now knows based on the IP which VLAN to pull the device name from.

You're Query log will look like this. Note how it tacks on the VLAN identifier to the end of the devices name.