Community discussions

MikroTik App
 
rjow2021
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Thu Nov 19, 2020 6:26 pm

Manual DNS for individual clients?

Wed Nov 25, 2020 4:15 pm

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,
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19323
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Manual DNS for individual clients?

Wed Nov 25, 2020 4:30 pm

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!
 
rjow2021
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Thu Nov 19, 2020 6:26 pm

Re: Manual DNS for individual clients?

Wed Nov 25, 2020 4:35 pm

Easier to assign users to vlans based on their DNS preference LOL.
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.
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Manual DNS for individual clients?  [SOLVED]

Wed Nov 25, 2020 7:04 pm

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
 
User avatar
xvo
Forum Guru
Forum Guru
Posts: 1237
Joined: Sat Mar 03, 2018 1:12 am
Location: Moscow, Russia

Re: Manual DNS for individual clients?

Wed Nov 25, 2020 8:33 pm

Or create a more specific dhcp-server network(s) with different dns-server specified.
 
rjow2021
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 59
Joined: Thu Nov 19, 2020 6:26 pm

Re: Manual DNS for individual clients?

Wed Nov 25, 2020 10:10 pm

Make dhcp entries static then assign dhcp option 6; they will override dhcp network setting.
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.
 
User avatar
erkexzcx
Member Candidate
Member Candidate
Posts: 263
Joined: Mon Oct 07, 2019 11:42 pm

Re: Manual DNS for individual clients?

Thu Nov 26, 2020 11:47 am

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... :D

Who is online

Users browsing this forum: Amazon [Bot], GoogleOther [Bot] and 28 guests