Don
Don

Reputation: 4202

Chrome won't resolve Vagrant/VirtualBox host?

Due to .dev now being a gTLD and forcing redirects to https in Chrome, I set up a new development environment using PuPHPet with the domain awesome.localhost instead of the previous default awesome.dev.

Chrome doesn't resolve it at all and returns an ERR_EMPTY_RESPONSE message and no errors or information in console.

I can successfully ping the domain and the IP matches. It also works fine in Firefox and Internet Explorer.

Using the IP Address associated with the server in Chrome correctly returns the instructions page for adding the virtual hosts to the hosts file.

How can I resolve this? What could be causing this?

Chrome Version 63.0

Upvotes: 1

Views: 604

Answers (1)

ceejayoz
ceejayoz

Reputation: 180137

I believe Chrome bypasses DNS entirely for .localhost domains and just internally resolves it to 127.0.0.1 at all times.

RFC 6761 reserves the .test, .localhost, .example, and .invalid TLDs. I'd use .test for these sorts of internal host names.

Per the RFC:

The domain "localhost." and any names falling within ".localhost." are special in the following ways:

  1. Users are free to use localhost names as they would any other domain names. Users may assume that IPv4 and IPv6 address queries for localhost names will always resolve to the respective IP loopback address.
  1. Application software MAY recognize localhost names as special, or MAY pass them to name resolution APIs as they would for other domain names.
  1. Name resolution APIs and libraries SHOULD recognize localhost names as special and SHOULD always return the IP loopback address for address queries and negative responses for all other query types. Name resolution APIs SHOULD NOT send queries for localhost names to their configured caching DNS server(s).
  1. ...

Upvotes: 2

Related Questions