Our developers use either Docker or VirtualBox (with Vagrant) to test their code locally (and the problem happens with both). To facilitate this, we modify /etc/hosts to point to the correct IP address. For example,
Some of our developers are on Linux and some are on macOS Sierra (10.12.3). On Mac, requests to local.test.company.com in Chrome (and other browsers) often take a long time (up to a minute or more) to resolve. (The problem doesn't happen on Ubuntu Linux.) During this time, the "loading icon" on the tab is the gray icon spinning to the left. As soon as it changes to the blue icon spinning to the right, it finishes very quickly. The slow loading time can be a real problem for our developers who often refresh the site during development.
Based on this question, it seems that Chrome is taking a full minute to resolve the site. This doesn't make sense to me - a site in /etc/hosts should resolve immediately. Some developers can reproduce this behavior very consistently. Others see it intermittently or don't see it at all, and I have not been able to figure out why.
Why do the requests to local.test.company.com take a long time to resolve in a web browser?
Or, what can I do to "debug" this problem and figure out what's taking so long?
- The behavior continues to happen with Chrome in "incognito mode" with "disable cache" turned on.
- ping resolves local.test.company.com immediately.