Community discussions

 
dragonauta
just joined
Topic Author
Posts: 23
Joined: Thu Feb 02, 2017 12:50 am

how can I setup mikrotik + local dns server

Thu Oct 26, 2017 2:30 pm

Hello.
I recently bought a Routerboard 951G-2HnD.
I used defaults since it's for my home LAN, I need no fancy configuration.
Just some port forwarding that I already know how to do it.
I changed network segment from 192.168.88.0 to 192.168.0.0

Problem is I have no local name resolution. Maybe you can point me in ther right direction.

I have a dnsmasq server that was running perfect.
On my previous router TP-Link I had 192.168.0.254 (dnsmasq) as primary DNS and 192.168.0.1 (router) as secondary.
DHCP on router gave those DNS to clients. So, local resolution was made by dnsmasq and internet by router.
I could ping by name any of my hosts (windows+linux). Hell, even I have a reverse proxy that looks for services using local FQDN instead IP.

As I said, I have 951G working. I can surf but I can't reach any of my local services/servers by name.
so I set dnsmasq as DNS1 and router as DNS2, but then everything stopped working, even surfing the web.
Also if I set DNS1 router and DNS2 dnsmasq; I have resolution but really slow (4-5 seconds until ping). dnsmasq is connected via ethernet

Maybe I have to add some layer7-protocol and mangle rules?? https://www.dalemacartney.com/2012/12/2 ... -routeros/

Thanks
 
User avatar
matiaszon
Member
Member
Posts: 305
Joined: Mon Jul 09, 2012 9:26 am

Re: how can I setup mikrotik + local dns server

Fri Oct 27, 2017 12:02 pm

Not sure, if this is what you are looking for, but did you try to add static DNS in MikroTik?
 
User avatar
harvey
Member Candidate
Member Candidate
Posts: 101
Joined: Thu Apr 05, 2012 8:16 pm

Re: how can I setup mikrotik + local dns server

Sat Oct 28, 2017 4:22 pm

Hello.
I recently bought a Routerboard 951G-2HnD.
I used defaults since it's for my home LAN, I need no fancy configuration.
Just some port forwarding that I already know how to do it.
I changed network segment from 192.168.88.0 to 192.168.0.0

Problem is I have no local name resolution. Maybe you can point me in ther right direction.

I have a dnsmasq server that was running perfect.
On my previous router TP-Link I had 192.168.0.254 (dnsmasq) as primary DNS and 192.168.0.1 (router) as secondary.
DHCP on router gave those DNS to clients. So, local resolution was made by dnsmasq and internet by router.
I could ping by name any of my hosts (windows+linux). Hell, even I have a reverse proxy that looks for services using local FQDN instead IP.

As I said, I have 951G working. I can surf but I can't reach any of my local services/servers by name.
so I set dnsmasq as DNS1 and router as DNS2, but then everything stopped working, even surfing the web.
Also if I set DNS1 router and DNS2 dnsmasq; I have resolution but really slow (4-5 seconds until ping). dnsmasq is connected via ethernet

Maybe I have to add some layer7-protocol and mangle rules?? https://www.dalemacartney.com/2012/12/2 ... -routeros/

Thanks
Is there any specific requirement on the dnsmasq server? You can do something similar to:-
/ip dns
set allow-remote-requests=yes servers=208.67.222.222,208.67.220.220
'allow-remote-requests' allows your mikrotik to respond to DNS requests and servers=208.67.222.222,208.67.220.220 tells the Mikrotik where to look up answers it doesn't know.

Then you can add static entries like so:-
/ip dns static
add address=10.10.1.1 name=router.home.lan
add address=10.10.1.10 name=nas.home.lan
Then in your DHCP set your the Mikrotik as your DNS server with:-
/ip dhcp-server network
add address=10.10.1.0/24 dns-server=10.10.1.1 domain=home.lan gateway=10.10.1.1 netmask=24
I would also make sure can ping DNS names directly on the Mikrotik:-
/ping google.com count=5
  SEQ HOST                                     SIZE TTL TIME  STATUS
    0 216.58.201.46                              56  56 17ms
    1 216.58.201.46                              56  56 14ms
    2 216.58.201.46                              56  56 16ms
    3 216.58.201.46                              56  56 15ms
    4 216.58.201.46                              56  56 14ms
    sent=5 received=5 packet-loss=0% min-rtt=14ms avg-rtt=15ms max-rtt=17ms
If you do want to use your dnsmasq server connect up to it, can it do DNS lookups it's self, does it still have internet connectivity, did your router address stay the same or does the gateway on the DNSMasq server need updating?

Who is online

Users browsing this forum: No registered users and 8 guests