Custom DNS for Different VLANs/Interface

Good day,

I have this situation where i need to create 4 VLANS with 4 interface

VLAN 10 - adults
VLAN 20 - kids
VLAN 30 - others/guest( to be turned on if guest is present)

what i wanted to do is assign different DNS servers for each vlan/interface
vlan10 - antiphising dns
vlan20 - kidsafe dns/opendns
vlan30- google dns/cloudflare dns

I also already untick Use DNS servers advertised by peer on the WAN interface

and placed the DNS ip address on use custom DNS server per interface,
at first i thought it was working but when i created the other interfaces ( referring to Kids interface/vlan20 and guest interface/vlan30)
they are using the DNS for adults interface/VLAN10

can someone point me to the right direction,
im stil not very good at openwrt and if possible i wanted to use LuCi to configure, if not, please guide me. Thank you

You need to advertise the respective nameserver to the hosts with dhcp. Otherwise you'd have to create multiple dnsmasq instances.

Remove these

you can let that as it was.

1 Like

Where can i find it buddy

Referring to " advertise respective nameserver hosts"

You mentioned it already:

so I suppose you know them already.

Hi @midnextlevel
Within the interface definition on the dhcp server page there is a subpage Advanced settings with dhcp-options. Here you can advertise the dns servers, as it is already mentioned below the input fields:
6, 192.168.2.1 would advertise dns server 192.168.2.1 to the clients

5 Likes

Sorry to tell you but im confused with the syntax , what does "6," stands for? Thanks for the response

6 stands for dns. You can google dhcp-option list, you find for example:

https://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xhtml

or

You can even apply these options per mac address, so within the same interface you can use different dns servers for different devices. I do that for our ebook-readers tolino, as the ebook downloads are somehow interfering with pihole.

4 Likes

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