Community discussions

MikroTik App
 
SpaceCommander
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Fri Dec 26, 2008 3:35 am

Static DNS record does not suppress external one?

Fri Sep 20, 2013 9:56 pm

There is RouterOS 5.25, with DNS server enabled.
All clients are confugured to use ROS DNS only.

When "www.microsoft.com" is added to IP/DNS/Static as 10.20.30.40,
nslookup on client workstations returns multiple values - 10.20.30.40 and external ones.

How to suppress external DNS resolution for names presented in static DNS list?
I want to get 10.20.30.40 only.
 
User avatar
asaleh75
Trainer
Trainer
Posts: 193
Joined: Thu Nov 17, 2011 2:51 pm
Location: Dhaka, Bangladesh
Contact:

Re: Static DNS record does not suppress external one?

Fri Sep 20, 2013 10:01 pm

Hi,
Please check your work stations DNS entry. There should be only your router's IP.
 
SpaceCommander
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Fri Dec 26, 2008 3:35 am

Re: Static DNS record does not suppress external one?

Fri Sep 20, 2013 10:03 pm

Hi,
Please check your work stations DNS entry. There should be only your router's IP.
Yes, it is so, of course.
 
User avatar
asaleh75
Trainer
Trainer
Posts: 193
Joined: Thu Nov 17, 2011 2:51 pm
Location: Dhaka, Bangladesh
Contact:

Re: Static DNS record does not suppress external one?

Fri Sep 20, 2013 10:12 pm

Please provide your DNS configuration.
 
SpaceCommander
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Fri Dec 26, 2008 3:35 am

Re: Static DNS record does not suppress external one?

Fri Sep 20, 2013 10:26 pm

Please provide your DNS configuration.
Mikrotik Settings:
[admin@MikroTik] > /ip dns ex
# sep/20/2013 23:17:15 by RouterOS 5.25
# software id = N69E-277L
#
/ip dns
set allow-remote-requests=yes cache-max-ttl=1w cache-size=2048KiB max-udp-packet-size=4096 \
    servers=""
/ip dns static
add address=192.168.88.1 disabled=no name=router ttl=1d
add address=10.20.30.40 disabled=no name=microsoft.com ttl=1d

[admin@MikroTik] > /ip dns pr
                servers: 
        dynamic-servers: 8.8.8.8, 8.8.4.4
  allow-remote-requests: yes
    max-udp-packet-size: 4096
             cache-size: 2048KiB
          cache-max-ttl: 1w
             cache-used: 452KiB
Workstation Settings (Ubuntu + NetworkManager):
$ 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 127.0.0.1

$ pgrep -fl dns
801 /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/var/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.0.1 --conf-file=/var/run/nm-dns-dnsmasq.conf --cache-size=0 --proxy-dnssec

$ cat /var/run/nm-dns-dnsmasq.conf
server=192.168.88.1
Workstation Check:
$ host microsoft.com
microsoft.com has address 64.4.11.37
microsoft.com has address 65.55.58.201
microsoft.com has address 10.20.30.40
microsoft.com mail is handled by 10 microsoft-com.mail.protection.outlook.com.

$ host microsoft.com 192.168.88.1
Using domain server:
Name: 192.168.88.1
Address: 192.168.88.1#53
Aliases: 

microsoft.com has address 65.55.58.201
microsoft.com has address 64.4.11.37
microsoft.com has address 10.20.30.40
microsoft.com mail is handled by 10 microsoft-com.mail.protection.outlook.com.
 
User avatar
asaleh75
Trainer
Trainer
Posts: 193
Joined: Thu Nov 17, 2011 2:51 pm
Location: Dhaka, Bangladesh
Contact:

Re: Static DNS record does not suppress external one?

Fri Sep 20, 2013 10:39 pm

Hi,
I tested it on my network & working fine. Please try to redirect all dns traffic to router itself.
/ip firewall nat add action=redirect chain=dstnat disabled=no dst-port=53 protocol=udp src-address=192.168.88.0/24 to-ports=53
 
SpaceCommander
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Fri Dec 26, 2008 3:35 am

Re: Static DNS record does not suppress external one?

Fri Sep 20, 2013 10:52 pm

Hi,
I tested it on my network & working fine. Please try to redirect all dns traffic to router itself.
/ip firewall nat add action=redirect chain=dstnat disabled=no dst-port=53 protocol=udp src-address=192.168.88.0/24 to-ports=53
Hmmm...
It is very-very strange, but after adding this rule all works fine, as it should be.
And even after disabling this rule, all still works.
 
User avatar
asaleh75
Trainer
Trainer
Posts: 193
Joined: Thu Nov 17, 2011 2:51 pm
Location: Dhaka, Bangladesh
Contact:

Re: Static DNS record does not suppress external one?

Fri Sep 20, 2013 10:57 pm

It is very-very strange, but after adding this rule all works fine, as it should be.
And even after disabling this rule, all still works.
Good Luck
 
JackANSI
Frequent Visitor
Frequent Visitor
Posts: 71
Joined: Wed Apr 03, 2013 6:52 pm

Re: Static DNS record does not suppress external one?

Sat Sep 21, 2013 6:16 pm

Client devices tend to have a DNS cache... Be sure in the future to clear the MikroTik's cache as well as the computer you're running the test on.

Who is online

Users browsing this forum: mquan1984 and 133 guests