docksal: DNS detection should not use localhost as upstream
Description
I noticed a big internet slowdown on my laptop in the past few days. Speeds are consistently at the max that my ISP provides, but resolving domains takes an incredibly long time. Once a website responds, the remaining assets take several minutes to finish loading. Unable to find a solution, I thought Docksal might be at fault since it involves DNS changes. My other devices are not having any problems on the same network.
Shutting Docksal down does seem to be fixing the issue.
Steps to reproduce the issue:
- Running Ubuntu 16.04 on a Dell XPS.
- Running Docksal 1.69.1.
- Test DNS speed while Docksal is running (see below). A DNS lookup to Google is taking 21 seconds.
- Repeat #4 after shutting Docksal down. The same lookup takes less than 1 second.
Describe the results you received:
When docksal is running:
$ time dig google.com +nssearch
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 216.239.36.10 in 25 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 2001:4860:4802:34::a in 28 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 216.239.34.10 in 28 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 216.239.32.10 in 28 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 2001:4860:4802:32::a in 29 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 2001:4860:4802:36::a in 29 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 216.239.38.10 in 31 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 2001:4860:4802:38::a in 32 ms.
real 0m21.211s
user 0m0.012s
sys 0m0.004s
After executing fin system stop:
$ time dig google.com +nssearch
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 2001:4860:4802:34::a in 24 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 2001:4860:4802:32::a in 25 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 216.239.32.10 in 26 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 216.239.34.10 in 26 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 2001:4860:4802:36::a in 27 ms.
SOA ns1.google.com. dns-admin.google.com. 207882797 900 900 1800 60 from server 216.239.36.10 in 28 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 216.239.38.10 in 29 ms.
SOA ns1.google.com. dns-admin.google.com. 207861959 900 900 1800 60 from server 2001:4860:4802:38::a in 30 ms.
real 0m0.174s
user 0m0.036s
sys 0m0.004s
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 25 (14 by maintainers)
@mikestefanello what you are experiencing is an edge case of a new feature set. Previously Docksal was using Google DNS all the time by default. In latest fin I have built a functionality to detect upstream DNS and use it when possible. It should help those users in corporate networks who have external DNS servers blocked.
Also previously fin used Ubuntu 16.04 specific network manager configuration to only apply Docksal DNS to resolution to
.docksaldomains. However that setup was too specific and did not work not only in other repos, but even on Ubuntu 18.04. So we had to go with more generic DNS setup, that works everywhere.The edge case is that in DNS detection I created does not account for use-cases, when a user has locally installed name server, like you do. Docksal takes your DNS server from the resolv.conf and attempts to use it as an upstream, but inside the container
127.0.1.1creates a request loop to itself.As I described earlier you can specify upstream dns manually and set it to be Google DNS, which will effectively make the setup work the same way as it was before the update. Or you can disable your local name server, which will make new DNS detection work properly.
I will improve detection to account for local DNS servers in the next release.