Is it possible to install dnsmasq into routeros

I need dns cache server like dnsmasq, is there any way to install dnsmasq into routeros

RouterOS is a closed system. You can’t “install” any 3rd party tool. You could use MetaRouter, which allows you to run other OS “inside” routeros, like a virtual machine.

qubic you have dns cache service already built in into RouterOS. (IP > DNS, tick Allow remote requests)

Unless you have a very large network that needs to cope with more than 100 requests per second no need for a separate cache.

But dnsmasq can also be a name server for devices in the LAN.

that is also available at ip > dns > static

Thanks. I clicked on that, and then tried to ping devices who’s names are known to the router. But now my devices think that all host names have the IP address 92.242.140.2 instead of something in the 192.168.1.0 range.

[admin@MikroTik] /ip dhcp-server lease> print
Flags: X - disabled, R - radius, D - dynamic, B - blocked 
 #   ADDRESS                                        MAC-ADDRESS       HOST-NAME        SERVER        RATE-LIMIT        STATUS 
 0   192.168.1.10                                   BC:5F:F4:XX:XX:XX haggis           defconf                         bound  
 1   192.168.1.12                                   F8:CA:B8:XX:XX:XX MC0XMUDC         defconf                         bound  
 2   192.168.1.129                                  00:18:F8:XX:XX:XX LinksysPAP       defconf                         bound  
 3   192.168.1.128                                  00:90:A9:XX:XX:XX WDTVLiveLR\00    defconf                         bound  
 4   192.168.1.3                                    F8:7B:8C:XX:XX:XX                                                 waiting

$ ping -c3 MC0XMUDC
PING mc0xmudc (92.242.140.2) 56(84) bytes of data.
^C
--- mc0xmudc ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2015ms

$ ping LinksysPAP
PING linksyspap (92.242.140.2) 56(84) bytes of data.
^C
--- linksyspap ping statistics ---
10 packets transmitted, 0 received, 100% packet loss, time 8999ms

Hello:

92.242.140.2 belongs to some “Barefruit Ltd”. There are threads on this address on the internet.
May this be some kind of misconfiguration on your client?

Your dns settings should point to your mikrotik.
Depending on your OS, try a command like “nslookup” or “dig”.

They should report which dns is answering your request.
If it is not your mikrotik, check the dns settings on your client.

Hope this helps



[admin@MikroTik] /ip dns> print
                servers:           <<<<<<<<<<<<<<
        dynamic-servers: 68.105.28.11,68.105.29.11,68.105.28.12
  allow-remote-requests: yes
    max-udp-packet-size: 4096
   query-server-timeout: 2s
    query-total-timeout: 10s
             cache-size: 2048KiB
          cache-max-ttl: 1w
             cache-used: 300KiB

Are you saying that I should I add 192.168.1.1 (the router’s LAN IP address) in “servers:”? (I think you are, but want to be sure before cocking something up…)

Yes and no…
My router has this configuration:

/ip dns print
                servers: 208.67.220.220,208.67.222.222
        dynamic-servers: 
  allow-remote-requests: yes
    max-udp-packet-size: 4096
   query-server-timeout: 2s
    query-total-timeout: 10s
             cache-size: 2048KiB
          cache-max-ttl: 1w
             cache-used: 120KiB

The two servers are statically assigned.


But on the client I have:

cat /etc/resolv.conf 
#
# This file is automatically generated.
#
nameserver 192.168.88.1

where 192.168.88.1 is the mikrotik router.
In this way, when I ping names statically assigned by my router’s dhcp server, they are resolved by the router, and only if unknown to it they will be passed to the outside dns servers.

On your client pc/server (that is, not from the router)

nslookup router
Server:		192.168.88.1
Address:	192.168.88.1#53  <<<---- this is the dns resolving the name, the mikrotik router

Non-authoritative answer:
Name:	router
Address: 192.168.88.1

If I change the dns settings (i.e.: 8.8.8.8) on the client, and I get:

 nslookup router
Server:		8.8.8.8
Address:	8.8.8.8#53

** server can't find router: NXDOMAIN

this is expected, since the 8.8.8.8 dns does not know what “router” is.

Check if the “resolv.conf” in your client pc is set to your mikrotik router.

It does, along with my ISP’s name servers (presumably because the router DNS has “allow-remote-requests: yes”.

$ nslookup router
Server:		192.168.1.1
Address:	192.168.1.1#53

Non-authoritative answer:
Name:	router
Address: 192.168.1.1

$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1
nameserver 68.105.28.11
nameserver 68.105.29.11

Last try before I go out of ideas :smiley:
May you try

nslookup MC0XMUDC



dig MC0XMUDC
dig MC0XMUDC @192.168.1.1
dig MC0XMUDC @68.105.28.11

It appears to work, since I statically added those devices to the router DNS tables:

[admin@MikroTik] /ip dns static> print
Flags: D - dynamic, X - disabled 
 #    NAME            REGEXP           ADDRESS                                           TTL         
 0    router                           192.168.1.1                                       1d          
 1    haggis                           192.168.1.10                                      1d          
 2    MC0XMUDC                         192.168.1.12                                      1d          
 3    LinksysPAP                       192.168.1.129                                     1d          
 4    726729_Extender                  192.168.1.3                                       1d



$ nslookup MC0XMUDC
Server:		192.168.1.1
Address:	192.168.1.1#53

Non-authoritative answer:
Name:	mc0xmudc
Address: 192.168.1.12

$ dig MC0XMUDC

; <<>> DiG 9.10.3-P4-Ubuntu <<>> MC0XMUDC
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54637
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mc0xmudc.			IN	A

;; ANSWER SECTION:
mc0xmudc.		86400	IN	A	192.168.1.12

;; Query time: 0 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Wed Nov 02 17:34:47 CDT 2016
;; MSG SIZE  rcvd: 42