Community discussions

MikroTik App
 
stanelie
newbie
Topic Author
Posts: 30
Joined: Sun Jun 03, 2012 9:32 pm

DHCP option 6 multiple DNS server entries

Mon May 20, 2019 9:07 pm

Hello.
I am trying to push DHCP option 6 to DHCP clients to specify multiple DNS servers. I tried several syntaxes, but it only works with one entry enclosed in simple quotes. I tried '8.8.8.8','1.1.1.1' , or '8.8.8.8,1.1.1.1' , no go on both. If I only specify one server ('8.8.8.8'), it works as expected.
Thoughts?
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: DHCP option 6 multiple DNS server entries  [SOLVED]

Mon May 20, 2019 10:25 pm

I'd probably just set DNS in "/ip dhcp-server network", but if you insist on overriding that option, this works:
/ip dhcp-server option
add code=6 name=dnstest value="'1.1.1.1''8.8.8.8''1.0.0.1''8.8.4.4'"
 
stanelie
newbie
Topic Author
Posts: 30
Joined: Sun Jun 03, 2012 9:32 pm

Re: DHCP option 6 multiple DNS server entries

Mon May 20, 2019 10:28 pm

I'll try with your syntax, thanks!
 
stanelie
newbie
Topic Author
Posts: 30
Joined: Sun Jun 03, 2012 9:32 pm

Re: DHCP option 6 multiple DNS server entries

Tue May 21, 2019 4:25 pm

Yup,
It worked! Thanks a lot! I wish the wiki had better examples and clearer syntax explanations.
 
Sob
Forum Guru
Forum Guru
Posts: 9121
Joined: Mon Apr 20, 2009 9:11 pm

Re: DHCP option 6 multiple DNS server entries

Tue May 21, 2019 4:53 pm

Manual/wiki is not too bad. It's just that when you create options manually, you're really creating raw bytes that will be sent to clients and you need to undestand what exact format each option uses. For DNS it's four bytes for first address, four bytes for another, etc. And the '10.10.10.10' as simpler way how to enter address (instead of hexadecimal numbers) is documented. There could be more examples, sure. But specifically this DNS option can be set in "/ip dhcp-server network", so you shouldn't even need to create it manually.
 
stanelie
newbie
Topic Author
Posts: 30
Joined: Sun Jun 03, 2012 9:32 pm

Re: DHCP option 6 multiple DNS server entries

Tue May 21, 2019 4:57 pm

Oh!
I missed that tab (Networks)!
Thanks for the cue, I'm a noob. :)

Who is online

Users browsing this forum: dawdler and 131 guests