Can’t Google Chrome resolve subdomains from /private/etc/hosts


If I define subdomains in /private/etc/hosts on OS X, such as test.localhost, Google Chrome (51.0.2704.106 (64-bit)) isn't able to resolve them (even though it worked until today). Other browsers (e.g. Firefox) are able to resolve them just fine on the other hand.

The reported error is this:

The following error was encountered while trying to retrieve the URL: http://test.localhost:8080/

Unable to determine IP address from host name test.localhost

The DNS server returned:

Name Error: The domain name does not exist.
This means that the system was not able to resolve the hostname presented in the URL. Check if the address is correct.

Why is Chrome unable to resolve subdomains from the hosts file?

My /private/etc/hosts file currently looks like this, the last entry being the one I'm testing:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##   localhost broadcasthost
::1             localhost
fe80::1%lo0 localhost plugins.docker login.docker test.localhost

Best Answer

The cause of this error was the ZenMate proxy extension being enabled in Chrome, apparently it is unable to handle "subdomain" local DNS entries.