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. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost 192.168.59.103 plugins.docker 192.168.59.103 login.docker 127.0.0.1 test.localhost