# Pi-Hole VLAN advice using 05-custom.conf or define VLAN interfaces

**URL:** <https://discourse.pi-hole.net/t/pi-hole-vlan-advice-using-05-custom-conf-or-define-vlan-interfaces/38982>\
**Category:** Community Help\
**Created:** [October 3, 2020, 9:16am UTC](https://discourse.pi-hole.net/t/pi-hole-vlan-advice-using-05-custom-conf-or-define-vlan-interfaces/38982 "2020-10-03T09:16:35Z")\
**Posts on this page:** 5\
**Page:** 4

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [October 7, 2020, 6:33pm UTC](https://discourse.pi-hole.net/t/pi-hole-vlan-advice-using-05-custom-conf-or-define-vlan-interfaces/38982/61 "2020-10-07T18:33:26Z")

</div>

I use the following lines to send MAC and IP info to my upstream Pihole (`10.0.1.5`)

```auto
"service": {
		"dns": {
			"forwarding": {
				"options": [
					"add-mac",
					"server=10.0.1.5",
					"add-subnet=32"
				]
			}
		}
}

```

> [@Kopernikus](#):
>
> There's only 1 thing I'm not sure off, in my current config I have rules setup in my config.gateway.json to ctach devices that have hardcoded DNS to redirect them to the pihole and also masq the connection.

I had a similar approach once but decided to block non-router/pihole DNS traffic completely. So far all devices (google) fell back to the DHCP announced DNS servers. You'r approach should work too, but I think in such cases they will appear in your pihole as if coming from your router (including the MAC?) and EDNS(0) will not work with redirected traffic.

---

<div class="post-metadata">

**Author:** ![Kopernikus](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/k/7feea3/32.png) [@Kopernikus](https://discourse.pi-hole.net/u/Kopernikus)\
**Post date:** [October 7, 2020, 6:38pm UTC](https://discourse.pi-hole.net/t/pi-hole-vlan-advice-using-05-custom-conf-or-define-vlan-interfaces/38982/62 "2020-10-07T18:38:18Z")

</div>

> [@yubiuser](#):
>
> I use the following lines to send MAC and IP info to my upstream Pihole ( `10.0.1.5` )
> 
> ```auto
> "service": {
> "dns": {
> "forwarding": {
> "options": [
> "add-mac",
> "server=10.0.1.5",
> "add-subnet=32"
> ]
> }
> }
> }
> 
> ```

Ok, thx.  
Do you think adding a second server IP would work? (I have 2 Pihole's)  
So, you've set all you vlans to default dhcp dns, and changed the ones from your WAN to the Pi-Hole?

---

<div class="post-metadata">

**Author:** ![yubiuser](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/yubiuser/32/12100_2.png) [@yubiuser](https://discourse.pi-hole.net/u/yubiuser)\
**Post date:** [October 7, 2020, 6:41pm UTC](https://discourse.pi-hole.net/t/pi-hole-vlan-advice-using-05-custom-conf-or-define-vlan-interfaces/38982/63 "2020-10-07T18:41:54Z")

</div>

> [@Kopernikus](#):
>
> Do you think adding a second server IP would work? (I have 2 Pihole's)

I would start with one and see how it goes. I'm not 100% sure about the syntax, but guess a second DNS server needs a second `server=` line.

> [@Kopernikus](#):
>
> So, you've set all you vlans to default dhcp dns, and changed the ones from your WAN to the Pi-Hole?

Exactly.

---

<div class="post-metadata">

**Author:** ![Kopernikus](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/k/7feea3/32.png) [@Kopernikus](https://discourse.pi-hole.net/u/Kopernikus)\
**Post date:** [October 16, 2020, 5:40am UTC](https://discourse.pi-hole.net/t/pi-hole-vlan-advice-using-05-custom-conf-or-define-vlan-interfaces/38982/64 "2020-10-16T05:40:51Z")

</div>

Hi,

I've got it all working after a factory reset of my Ubiquiti switch.  
The solution provided by @deHakkelaar as response to my original post seems to be working perfect.  
Except that the vlans need to be set in a vlans in file dnsmasq.d folder instead of directly into the dnsmasq.d file. Also there's no need the install the vlan package or 802.1q mod.

Thx!

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [November 6, 2020, 5:40am UTC](https://discourse.pi-hole.net/t/pi-hole-vlan-advice-using-05-custom-conf-or-define-vlan-interfaces/38982/65 "2020-11-06T05:40:54Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

[Previous page](https://discourse.pi-hole.net/t/pi-hole-vlan-advice-using-05-custom-conf-or-define-vlan-interfaces/38982.md?page=3)
