Guest User!

You are not Sophos Staff.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DNS query timeout

Hi all,

since we installed the Sophos UTM 100 a couple of months ago, sometimes we have problems accessing websites. As we use Active Directory in our local net DNS queries should go this way:
Client (DNS Server: SBS2011) -> Small Business Server 2011 (forwarder to the UTM) -> Sophos UTM (forwarder to two DNS servers of our ISP) -> DNS server of our ISP
I added the internal network to the allowed networks of the DNS service and two DNS servers of our ISP to the DNS forwarders.

The problem in detail:
Most of the time we don't have any problems accessing the internet. But at different times a number/all of us cannot access the internet. So there seems to be neither a general problem (for example a missing entry in the firewall) nor a special "event" (for example a disconnect every 24h by our ISP) which could be responsible for this.
After this error occurs, you have to wait one or two minutes and then everything works fine again.
The typical entry in the webfilter log looks like this:
2014:09:03-09:28:24 SophosUTM httpproxy[18246]: id="0003" severity="info" sys="SecureWeb" sub="http" request="(nil)"  function="dns_expire" file="dns.c" line="187" message="dns query c7ef (Google) timed out, retransmitting (retry 1)"
2014:09:03-09:28:24 SophosUTM httpproxy[18246]: id="0003" severity="info" sys="SecureWeb" sub="http" request="0x15aa0368" function="sc_categorize_url_remote" file="scr_scanner.c" line="993" message="no categorization received for url: https://www.google.de/"
2014:09:03-09:28:25 SophosUTM httpproxy[18246]: id="0002" severity="info" sys="SecureWeb" sub="http" name="web request blocked" action="block" method="CONNECT" srcip="192.168.10.103" dstip="" user="" statuscode="502" cached="0" profile="REF_DefaultHTTPProfile (Default Web Filter Profile)" filteraction="REF_HttCffAllow (L&L Standard)" size="2465" request="0x16e306e8" url="www.google.de/" exceptions="" error="Host not found" authtime="0" dnstime="10001064" cattime="10896533" avscantime="0" fullreqtime="20937909" device="0" auth="0" category="9999" reputation="neutral" categoryname="Categorization failed"


There are no entries in the log of the firewall or of the intrusion prevention system for this specific time.

Before the UTM was installed, we didn't have problems like this. So the DNS server of our provider seem to work fine (or at least they did [;)]).

If there's already a solution somewhere in this forum, please post the link as I didn't find it. Otherwise do you have any ideas how to fix this problem?

Best regards 
Thilo


This thread was automatically locked due to age.
  • In my tests dnstime of 2-9 microseconds are related to cached DNS entries (look at the scrshot - first DNS query was real other was cached).

    Your 3000 microseconds are still much better then mine 156000 ... [:)]

    I think your problem is in fullreqtime great value, related to slow web browsing or slow web server response.
  • Ok, so this doesn't seem to be the problem, too. I just mentioned it because this value was somehow different from the others. What else could be responsible for a DNS query lasting so long, if there doesn't seem to be a general issue with all the DNS servers?
  • I am still not convinced that DNS is your problem, but just to check...Do you have another firewall solution in front of UTM ?

    I've had a similar problem with a client with Cisco 1941 in front of UTM with DNS inspection enabled.
  • There's a stateful inspection firewall between the UTM and the internet. But as the UTM sends its query directly to the public DNS server, this query just passes the SIF without being handled by it in any way (there's a rule "allow DNS queries from the UTM to the internet). If the SIF wasn't configured correctly, no DNS query would pass. But as we don't have any problems with visiting websites mostly, the rule of the SIF seems to be OK.
  • In my case with a client, browsing was incredible slow but not for all sites, and not always. Cisco 1941 was configured to allow UTM -> Any -> Internet traffic, but after several weeks of troubleshooting disabling DNS inspection on the Cisco solved the problem.

    Few days before the solution we managed to narrow the problem to the websites with many external objects (like portals, news etc.). Looking at the log file we found that in order to open a local news site (popular with the users), around 30-40 DNS queries had to be executed.
    Still don't know what was the problem with that Cisco configuration (I am not a Cisco expert), anyway it was retired a few months later, and UTM is now connected directly to Internet.
  • I'll ask the support of Lancom (vendor of the SIF), if something like this could be the problem. But we cannot connect the UTM directly to the internet as the Lancom device is used as Modem, too.

    It's not a problem with some special websites. One moment I can visit a local news site and five minutes later I receive a timeout, when I want to visit the same site again.
  • All times in the log are in microseconds.  Therefore dnstime="3178" is 3 milliseconds.  This suggests that it did not get the answer from on-box DNS cache but from something else on your LAN.

    In general, you'll see groups of timings.  The DNS answer could be cached on box, on LAN, or on internet DNS servers.  *very* roughly they should match ping times.  So if you get a DNS answer that is 40ms and you can ping Google DNS in 35ms...  Chances are that is where the answer came from.

    Please note that if you are not doing any HTTPS scanning and you visit an HTTPS site the log line is only printed when the SSL connection is closed and will have a fullreqtime= that is equal to the total connection time, it could be minutes.  In the log line you printed it was an HTTPS connection for 14 seconds, perfectly normal.

    There are other times that fullreqtime is normally quite high, streaming media and periodic pings for example.

    Try a command like this:
    grep -v https /var/log/http.log | egrep 'dnstime="[0-9]{7}' | less –S

    This should give you all times that dnstime was over 1 second.  Similar grep can be used for fullreqtime.  Be warned, doing these searches can find a lot of false positives and red herrings.
  • Maybe my first example was a little bit misleading. This happens not only, if I visit HTTPS websites, but if I visit HTTP sites, too:
    2014:09:03-09:29:50 SophosUTM httpproxy[18246]: id="0002" severity="info" sys="SecureWeb" sub="http" name="web request blocked" action="block" method="GET" srcip="192.168.10.103" dstip="" user="" statuscode="502" cached="0" profile="REF_DefaultHTTPProfile (Default Web Filter Profile)" filteraction="REF_HttCffAllow (L&L Standard)" size="2456" request="0x8900308" url="www.sport1.de/" exceptions="" error="Host not found" authtime="0" dnstime="10001227" cattime="10941970" avscantime="0" fullreqtime="20947178" device="0" auth="0" category="9999" reputation="neutral" categoryname="Categorization failed" application="http"

    So is it normal, that a web request is blocked, if none of the DNS servers responds in a specific time? Or is there any other reason why it is blocked and why the UTM can't find a DNS server?

    I'll try the above-mentioned command the next time the problem appears and keep you up to date.
  • dnstime="10001227" ?

    That´s definately not good.

    How is your DNS setup ?

    Client => internal DC/DNS => UTM DNS Proxy => Public DNS ?

    I´ve seen shortly a customer setup, where the customer also configured public DNS servers on his internal DNS forwarder which failed. This customer got always a few secs delay from DNS lookups, because the internal resolver had to fallback to root dns lookups, wich slowed down internetsurfing to opening a website within >1min.

    After fixing the DNS Scenario Websurfing became lightning fast.

    so make sure, that internal clients request internal DNS server, internal DNS server requests EXCLUSIVELY the UTM DNS forwarder (make sure internal DNS is in allowed networks), and UTM requests a availability group as described earlier in this thread with 4-6 FAST DNS servers in there...I use Local ISP DNS and Google and OpenDNS Servers in the availability group.
  • Hi Sascha,

    as written in my first post the way you described is exactly how DNS is set up in our LAN.

    I use two DNS servers of our ISP (as described above, these two are faster than any other external DNS server checked with the DNS benchmark tool) and one DNS server of the "Chaos Computer Club".