Community discussions

 
NonesZA
just joined
Topic Author
Posts: 4
Joined: Sat Mar 02, 2013 11:48 pm

DNS resolution - intermittent issue - possible solution

Sun Mar 03, 2013 12:10 am

Hi All,
I'm new to the forum so forgive me if the post is in the wrong place.
Hardware RB751G-2HnD
RouterOS 5.16, 5.24 and 6.0rc11

Problem:
I have been having problems with DNS resolution for the past 2 weeks. Every now and then while browsing the internet, webpages refuse to load. I can however ping 8.8.8.8 so my internet connection is still active. Sometimes flushing the DNS cache seemed to fix the issue but other times not, I then resorted to rebooting the RB. This did not always work.
Eventually my ISP told me to start using the Google DNS servers instead of their own servers, this also solved the problem for a little while. I even set the DHCP client on the gateway interface to "Use Peer DNS".
What I then figured out is that it was sometimes taking longer than 1,5 to 2 seconds to even ping the DNS servers (both Google and the ISP) thanks to the wonderful South African internet. I tried to find a way to set the DNS resolution timeout in v5 but could not find the setting anywhere.

Eventually I upgraded to 6.0rc11 and the problem still persisted.

Solution:
Thank goodness there seems to be an undocumented feature in v6 for DNS:
In terminal I ran the following:
ip dns
set query-server-timeout=4s

This seems to have solved my issue for now (the default value was 2s).

Thank you to the RouterOS developers for adding this!!

Regards,
NonesZA
 
Ivoshiee
Member
Member
Posts: 471
Joined: Sat May 06, 2006 4:11 pm

Re: DNS resolution - intermittent issue - possible solution

Sun Mar 03, 2013 4:09 pm

If it indeed does help then I would as for that feature to be ported to v5 series as well.
 
NonesZA
just joined
Topic Author
Posts: 4
Joined: Sat Mar 02, 2013 11:48 pm

Re: DNS resolution - intermittent issue - possible solution

Sun Mar 10, 2013 1:19 pm

Update:

Seems like the above did not work, still received DNS lookup timeouts.

Increased timeout values to:
[XXXX@MikroTik] /ip dns> print
servers: 168.210.2.2,
dynamic-servers:
allow-remote-requests: yes
max-udp-packet-size: 4096
query-server-timeout: 10s
query-total-timeout: 20s
cache-size: 2048KiB
cache-max-ttl: 1w
cache-used: 99KiB

Interestingly, I have a secondary DNS entry set in the "gui" but it does not show up on the print...

Even with the 10s and 20s timeouts set, I am still having issues. Another issue I have noticed is that if I continuously ping 8.8.8.8, one a wired connection to my router, I get pings of around 250ms. However, on a wireless connection, at the exact same time, the pings are around 3s to 10s. The wifi signal strength is -28 so should be perfect. Any suggestions?
 
NonesZA
just joined
Topic Author
Posts: 4
Joined: Sat Mar 02, 2013 11:48 pm

Re: DNS resolution - intermittent issue - possible solution

Sat Mar 16, 2013 11:00 am

I found another topic in the ROS6Beta forum that recommends increasing the cache size and reducing the ttl, so giving it a try (reverted the increased timeouts):
/ip dns>> print
servers:
dynamic-servers: 192.168.1.1
allow-remote-requests: yes
max-udp-packet-size: 8192
query-server-timeout: 2s
query-total-timeout: 10s
cache-size: 8192KiB
cache-max-ttl: 1h
cache-used: 134KiB

Hope it works...
 
User avatar
ohara
Member
Member
Posts: 371
Joined: Mon Jun 13, 2011 11:30 pm
Location: Warsaw

Re: DNS resolution - intermittent issue - possible solution

Sat Mar 16, 2013 11:01 am

I had experienced DNS timeouts on RB751G-2HnD and RB951-2n with 5.24 and FW 3.04/3.05 for the past 2 weeks. After downgrade to 5.21 and FW 3.0 the problem seems to be gone. I haven't contacted support, but I will keep browsing the forum for updates.

This morning I replaced one of the devices with a new RB951G-2HnD that has 5.24 and so far web browsing works just fine.
 
jure1873
just joined
Posts: 3
Joined: Fri Apr 13, 2012 10:19 am

Re: DNS resolution - intermittent issue - possible solution

Mon Jul 29, 2013 9:00 pm

I'm also having problems with dns resolution in 5.24. I've just checked the changelog for 5.25, but there aren't any changes regarding dns so I won't upgrade yet.
 
lsettembri
just joined
Posts: 23
Joined: Tue Jan 14, 2014 10:04 pm

Re: DNS resolution - intermittent issue - possible solution

Fri Sep 05, 2014 10:41 pm

I know this is old, but I'm having this same issue. Could you please share If you have found a solution? Thanks a lot!
 
pablitobs
just joined
Posts: 9
Joined: Thu Jul 16, 2015 6:35 pm

Re: DNS resolution - intermittent issue - possible solution

Mon Jan 11, 2016 9:29 pm

Having the same issue on a brand new RB951G-2HnD version 6.33.3, any help?
 
pablitobs
just joined
Posts: 9
Joined: Thu Jul 16, 2015 6:35 pm

Re: DNS resolution - intermittent issue - possible solution

Wed Jan 20, 2016 4:42 am

Having the same issue on a brand new RB951G-2HnD version 6.33.3, any help?
Ok after many hours browsing and trying I found the problem it was due to TCP MSS packet size as some one in other forum suggested, basically the problem is that when you configure the pppoe to modify the TCP MSS it adds two rules to the mangle section at the firewall, but sometimes this rules are not correct, don't know if this is a bug on Mikrotik or an error from the ISP, so you get a lot of fragmentation from the packages so for some sites when you browse the packages are sent and dropped, and sent and dropped in a loop until the time out error appears, the first step is to set up the pppoe profile->General->Change TCP MSS to default value. then on Mangle tab at Firewall Section create a new rule with:

[GENERAL TAB]
Chain: forward
Protocol: tcp
Out. Interface: your out interface (pppoe-out in my case)

[ADVANCE TAB]
TCP Flags: syn

[ACTION TAB]
Action: Change MSS
New TCP MSS: here is the catch, here you define the size of the package if its too high you will have DNS problems and fragmentation, if its too small you will have other problems, in my case setting it to 133 did the trick
Passthrough: checked.

At PPP section on the Interface for pppoe the Max MTU was set to 1480, Max MRU to 1400 and MRRU to 1400

hope this helps someone else.
 
User avatar
bax
Member Candidate
Member Candidate
Posts: 269
Joined: Mon Dec 20, 2004 8:45 pm
Location: Croatia

Re: DNS resolution - intermittent issue - possible solution

Tue Jul 26, 2016 4:33 pm

pablitobs
Can you make export seting of ppp and firewall and post here?
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4051
Joined: Wed May 11, 2011 6:08 pm

Re: DNS resolution - intermittent issue - possible solution

Tue Jul 26, 2016 4:41 pm

I don't know why setting TCP adjust-mss would fix a DNS issue, since MSS is a value that is present in the TCP handshake procedure, and completely absent in UDP.
DNS uses UDP, which doesn't benefit from MSS adjustment.
(Some DNS clients may use TCP, but it's still quite a minority of the time that you'll find such a thing)
When given a spoon,
you should not cling to your fork.
The soup will get cold.
 
malcolmboston
just joined
Posts: 15
Joined: Fri Sep 02, 2016 3:02 pm

Re: DNS resolution - intermittent issue - possible solution

Mon Dec 19, 2016 2:54 pm

Has this issue ever been resolved?

Weve seen issues on pretty much every version from 6.29 onwards (havent really tested before).

I can find lots of topics regarding intermittent DNS failures but no concrete answer.

Who is online

Users browsing this forum: Baidu [Spider] and 89 guests