DNS Server

Hello everyone.

Im trying to get my Mikrot Router to act as the default DNS server if it can’t resolve LAN traffic DNS requests the Use Peer DNS.
When I request a Local Domain like ‘mcon’ from the router it resolves OK
When I request a Local Domain from my Ubuntu machine it Fails.
When I request a Extenral domain like ‘google.com’ it resolves the IP OK.

What am I doing wrong, any suggestions would be very appreciated.

/ip dns print
                      servers: 192.168.1.1
              dynamic-servers: 192.168.0.1
               use-doh-server: 
              verify-doh-cert: no
        allow-remote-requests: yes
          max-udp-packet-size: 4096
         query-server-timeout: 2s
          query-total-timeout: 10s
       max-concurrent-queries: 100
  max-concurrent-tcp-sessions: 20
                   cache-size: 2048KiB
                cache-max-ttl: 1w
                   cache-used: 113KiB



/ip dhcp-client print
Flags: X - disabled, I - invalid, D - dynamic 
 #   INTERFACE                                       USE-PEER-DNS ADD-DEFAULT-ROUTE STATUS        ADDRESS           
 0   ;;; defconf
     ether1-ISP                                      yes          yes               bound         192.168.0.10/24

It thurns out that mikrotik doesnt like one word domains as static.

 #    NAME              REGEXP             TYPE     ADDRESS                                             TTL         
 0  X ;;; defconf
      router.lan                                    192.168.1.1                                         1d          
 1    mobilesvr                                        192.168.1.150                                       1w3d            
 2    mobilesvr.lan                                 192.168.1.150                                       1w3d

dig ‘mobilesvr.lan’ returns 192.168.1.150
dig ‘mobilesvr’ returns SERVFAIL

As per RFC 1034 domain names are either absolute and are composed from multiple (that’s 2 or more) parts, delimited with a dot “.” … or relative which doesn’t contain a dot, and, when used, software needs to append domain name. Each DNS entry should be terminated with final dot, but it seems that most systems do it automatically when they encounter FQDN but not when they encounter name without domain (i.e. without a dot as used by user).

In short: don’t use names without dots as FQDN, this is not the standard way and breaks different systems in different ways.

A hint: try configuring named with trailing dots, e.g. “mobilesvr.” … but you’d probably have to do it both in MT DNS setup and on dig cmdline. I’m pretty sure you can’t go around this problem in DHCP server config though.

I cannot confirm that. It works for me.

Maybe you have fallen into the wellknown trap of “let me configure a number of DNS servers, a local one that does what I want to do, and a fallback of e.g. 8.8.8.8 in case it does not work”.
That is NOT possible with DNS! There is NO way to configure it like “when one server replies with an error, let’s try another one”. And in most environments it is NOT possible to specify a hardwired sequence of DNS servers to try in a fixed order.

So when you type “host mobilesrv” or “dig -t A mobilesrv” in your Ubuntu box (when it has more than one DNS server) there is no way to make that work all the time. That can only work when the mikrotik is the only DNS resolver the Ubuntu box will query.