Manual DNS for individual clients?

I have a PiHole on the network. I would like to know the best way to have clients on the PiHole DNS or not.
So, if clients want to be on the PiHole DNS, add them to a list for PiHole DNS, otherwise 1.1.1.1 or 1.0.0.1.
I could just statically set it on the each device. But wanted to see other suggestions to set this at router level.

I was thinking of using queues maybe? But having had the RB4011 for 2 weeks, coming from Asus, I’m still getting used to the MikroTik way of things.

Thanks,

Seems difficult to me,
Easier to assign users to vlans based on their DNS preference LOL.

I suppose if you knew their device mac addresses you do something with those!

Ah yes, I will have careful play with VLANs.

Although I’m looking at the IP > DHCP server > Networks, where I set my DNS; not IP > DNS, and I figure I could create a DHCP server pool here just for those that want to resolve via PiHole? EDIT: Forget that, not sure it would work.

That’s what I already like about MikroTik, many ways to skin a cat, so to speak.

Make dhcp entries static then assign dhcp option 6; they will override dhcp network setting.


/ip dhcp-server network
add address=192.168.88.0/24 dns-server=192.168.88.2,192.168.88.3 domain=home.local gateway=192.168.88.1
/ip dhcp-server option
add code=6 name="alt-dns1" value="'192.168.88.1'"
add code=6 name="alt-dns2" value="'8.8.8.8''8.8.4.4'"
/ip dhcp-server lease
add address=192.168.88.100 dhcp-option="alt-dns1" mac-address=12:34:56:78:9A:BC server=default
add address=192.168.88.101 dhcp-option="alt-dns2" mac-address=12:34:56:78:9A:BD server=default

Or create a more specific dhcp-server network(s) with different dns-server specified.

Absolutely amazing, thanks.

Who would have thought you could do this on a router! Two weeks into the MikroTik world and it’s looking great.

Who would have thought you could do this on a router!

Prior Mikrotik I had OpenWRT experience and there in DHCP server setting you have custom DHCP options and under the field there is a suggestion that “type this in order to give custom DNS to clients”. When I noticed DHCP options in Mikrotik that was the first thing that came to my mind - I can set DNS for clients here… :smiley: