Community discussions

MikroTik App
 
User avatar
petardo
newbie
Topic Author
Posts: 30
Joined: Fri Sep 25, 2015 4:06 pm

DHCP Server - DNS blank or router IP

Tue Apr 02, 2024 5:36 pm

What is best praxis by setting up dhcp server's network?
a) leaving the DNS field blank -> clients get the DHCP server's own IP as DNS server AND the DNS servers given in the router's DNS setting or
b) supplying a single DNS - the DHCP server IP
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3589
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DHCP Server - DNS blank or router IP

Tue Apr 02, 2024 7:51 pm

Kinda a preference thing IMO. Leaving /ip/dhcp-server/network's DNS blank is means "inherit" the /ip/dns ones. This allows default config to work... but often being explicit in config is more clear.

The central question is whether you want Mikrotik to do DNS caching? If you do, you need to enter the Mikrotik's IP as the DNS server in the DHCP network.

e.g. if you have a lot of clients... all clients periodically resolving google.com from the internet does increase traffic. And, if you need any local name resolution, then you do need to use the router's IP in the DHCP server's networks. The flip side is Mikrotik getting involved with DNS can occasionally introduce issues/bugs/oddities, so clients using DNS directly from ISP,Google,Cloudflare,etc. avoid that potential.
 
User avatar
petardo
newbie
Topic Author
Posts: 30
Joined: Fri Sep 25, 2015 4:06 pm

Re: DHCP Server - DNS blank or router IP

Tue Apr 02, 2024 10:01 pm

Yes, but I noticed that even if I leave blank the first item in the DNS addresses supplied will be the DHCP server's own IP in any case
e.g.
a) left blank:
192.168.88.1 (the DHCP server's IP)
192.168.0.1 (forwarded from dynamic servers DNS entry in IP/DNS)

b) filling with 192.168.88.1
192.168.88.1

So the difference is only that in case of left blank that it adds additionally the dynamic DNS entries as well.
And I don't know if adding additional DNSs has any advantage. I suppose that not.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3589
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DHCP Server - DNS blank or router IP

Tue Apr 02, 2024 10:48 pm

Yeah if you enable "Allow Remote Connections" in /ip/dns, that will add the Mikrotik router as DNS. If that's disabled, it be only the dynamic DNS (or any static DNS servers set).
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19602
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: DHCP Server - DNS blank or router IP

Tue Apr 02, 2024 10:59 pm

/ip dhcp-server network
add address=192.168.88.0/24 dns-server=192.168.88.1 gateway=192.168.88.1

/ip dns
set allow-remote-requests=yes servers=1.1.1.1
 
User avatar
petardo
newbie
Topic Author
Posts: 30
Joined: Fri Sep 25, 2015 4:06 pm

Re: DHCP Server - DNS blank or router IP

Wed Apr 03, 2024 12:32 am

Yeah if you enable "Allow Remote Connections" in /ip/dns, that will add the Mikrotik router as DNS. If that's disabled, it be only the dynamic DNS (or any static DNS servers set).
Now I understand, thanks for clarification.
Still remains the question whether it brings any advantage to have any DNS server on the DHCP's DNS list other than the DHCP server's IP address.
The secondary DNS brings only an advantage in the case if the first DNS - the router itself - doesn't reply.
However, if the router does not reply then you probable won't have a working Internet connection anyway.
So I came to the conclusion to not have this filed blank but have the DHCP server's IP address here.
 
neki
newbie
Posts: 49
Joined: Thu Sep 07, 2023 10:20 am

Re: DHCP Server - DNS blank or router IP

Wed Apr 03, 2024 1:23 am

Seems like lack of imagination... What if you want your client devices to use different server then the router itself? And why to use a router to resolve DNS requests on behalf of clients?
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3589
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: DHCP Server - DNS blank or router IP  [SOLVED]

Wed Apr 03, 2024 1:53 am

Still remains the question whether it brings any advantage to have any DNS server on the DHCP's DNS list other than the DHCP server's IP address.
The secondary DNS brings only an advantage in the case if the first DNS - the router itself - doesn't reply.
FWIW DNS clients are free to use any DNS server provided by DHCP (e.g. they are NOT ordered!). If you have a lot of user/devices, you'd like want to use only the Mikrotik DNS. Since I'd imagine the clients need the router to access the internet, the "backup" DNS may not help much. Generally the argument to give clients real DNS is some clients is additional caching slows upstream changes from appearing as quickly (e.g. since there cached, clients have to wait for the TTL to expire and unable to "force" DNS to re-resolve), but using real DNS to clients does increase internet bandwidth usage. So mixing the approaches does not seem like a good idea.

The rules on "blank DNS" in dhcp server's networks are really designed to make QuickSet's job easy. Why it's a bit complex to unwind. But won't use "blank DNS"'s logic to guide the "right" thing to do.
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11733
Joined: Thu Mar 03, 2016 10:23 pm

Re: DHCP Server - DNS blank or router IP

Wed Apr 03, 2024 7:09 am

Generally the argument to give clients real DNS is some clients is additional caching slows upstream changes from appearing as quickly (e.g. since there cached, clients have to wait for the TTL to expire and unable to "force" DNS to re-resolve)...
Every recursive DNS resolver (including your local Mikrotik and google) are entitled to caching records up to TTL expiration ... providing they pass their clients the remaining time as record's TTL. So upstream changes spreading time should not depend on number of caching DNS resolvers. It's domain's DNS admin's responsibility to shorten the TTL when changes are imminent to make this process faster.

Who is online

Users browsing this forum: Amazon [Bot], Bing [Bot], NxtGen [Bot] and 20 guests