Community discussions

MikroTik App
 
eredi
just joined
Topic Author
Posts: 5
Joined: Wed Oct 21, 2015 11:48 am

Force hotspot to use a specific DNS

Wed Oct 21, 2015 11:57 am

Hi all,

I'm trying to set a specific dns sever for the hotspot, i read in the wiki i have to set it in IP->DNS.
I wanted to have google DNS as backup so i set 4 servers:
servers: 52.19.x.x,52.19.x.x,8.8.8.8,8.8.4.4
dynamic-servers: 
    allow-remote-requests: no
    max-udp-packet-size: 4096
    query-server-timeout: 2s
    query-total-timeout: 10s
    cache-size: 2048KiB
    cache-max-ttl: 1w
    cache-used: 29KiB
the thing is that after a while it skips the first two and it starts to use the 3rd and some times the 4th
Do you have any idea why is doing that? what am i doing wrong?

PS: the first 2 servers works fine i have implemented in other solution and they work perfectly.

Thanks in advance
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Force hotspot to use a specific DNS

Wed Oct 21, 2015 5:49 pm

Read the wiki a second time, on IP > DNS you're setting the DNS the router uses for itself, and IF "allow-remote-requests" is enabled, will act as a DNS resolutor (with cache) to DNS petitions.

So if what you're looking for is the router to act as a DNS resolutor for hotspot clients, you should allow remote requests, and set router IP on the DHCP > Network > DNS Servers.
 
eredi
just joined
Topic Author
Posts: 5
Joined: Wed Oct 21, 2015 11:48 am

Re: Force hotspot to use a specific DNS

Wed Oct 21, 2015 6:41 pm

Hi pukkita,

thanks for the reply, however on the wiki : http://wiki.mikrotik.com/wiki/Manual:IP/Hotspot is saying:
dns servers (IP; Default: 0.0.0.0) => DNS server addresses used for HotSpot clients, configuration taken from /ip dns menu of the HotSpot gateway

I know seems weird but even if you set a specific dns server in the dhcp server the request of the HS client goes through the dns set in IP->DNS. My fist 2 dns have content filtering and i can confirm that if i set my dns in the dhcp server and google dns on the gateway the HS client dont get any content filtering. Once i set my dns in IP->DNS the user gets the block page has supposed.

What i dont understand is why the router is skipping to the 3rd and 4th DNS server. Is enough one timeout for the router to discard the DNS server?

Thanks
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Force hotspot to use a specific DNS

Thu Oct 22, 2015 11:22 am

I see... DNS requests from the hotspots clients are redirected to port 64872 of the router.

Not sure how servers are used if several are specified on ip > DNS, but maybe they're used in a round robin fashion? No details about that in the wiki.

If you want to have full control about which DNS server each hotspot client uses, you could use that same technique, i.e. use dst-nat to redirect outgoing DNS requests to an specific DNS server; but should be done without modifying the hotspot DNS NAT rules as it's used for the hotspot logic.
 
eredi
just joined
Topic Author
Posts: 5
Joined: Wed Oct 21, 2015 11:48 am

Re: Force hotspot to use a specific DNS

Thu Oct 22, 2015 11:38 am

Hi pukkita,

thanks for the reply, really appreciated. The thing is that if dst-nat to one of my server i wont be able to have a backup dns server, and if for any reason my dns do not work properly the clients won't be able to use the hotspot, unless you know a way to detect if the dns i'm forwarding to is working or not.
I'd like to know how the router choose the dns, if is actually round robin or what. do you know where i can find a proper RouterOs documentation? or do you think that if i contact support they can help me with that?

Thanks
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Force hotspot to use a specific DNS

Thu Oct 22, 2015 11:44 am

Contact support, they can help you with that for sure as they are pretty knowledgeable about their OS, and could probably lead to the wiki being updated with that information.
 
eredi
just joined
Topic Author
Posts: 5
Joined: Wed Oct 21, 2015 11:48 am

Re: Force hotspot to use a specific DNS

Thu Oct 22, 2015 11:53 am

Thanks pukkita.
I sent an email to support, let see what they say.
 
eredi
just joined
Topic Author
Posts: 5
Joined: Wed Oct 21, 2015 11:48 am

Re: Force hotspot to use a specific DNS

Thu Oct 22, 2015 12:44 pm

This is the support reply:

Hello,

> I basically need to know how under which circumstances the router
> decides to skip a DNS server and go to the next one.

RouterOS sends query to DNS server. If there is no reply from it, and other DNS
server is configured, RouterOS decreases contact ration for the particular
server.
After specific time RouterOS sends query again, if there is no reply, ration is
decreased even lower.

At the moment it is not possible to configure timeouts or other settings for
connection ratio, timeout or other features.

Regards,
Sergejs

--
Join our upcoming MUM conferences - Brazil, Argentina, Ukraine,
Moldova, Cuba, Costa Rica, Europe, United States !

Meet support engineers and learn about new products:
http://mum.mikrotik.com/
 
bosuagwu
just joined
Posts: 3
Joined: Tue Mar 10, 2015 11:46 am

Re: Force hotspot to use a specific DNS

Thu Oct 22, 2015 3:28 pm

I think what he wants is a DNS resolver :D .
 
User avatar
pukkita
Trainer
Trainer
Posts: 3051
Joined: Wed Dec 04, 2013 11:09 am
Location: Spain

Re: Force hotspot to use a specific DNS

Thu Oct 22, 2015 4:16 pm

You could also redirect to an external DNS server. In fact is what I do when I'm asked to enforce porn, ilicit sites access, etc, redirect to OpenDNS or similar.

That way users won't be able to use any other DNS as all requests will be intercepted and redirected.

Who is online

Users browsing this forum: No registered users and 47 guests