The .dev extension is no longer a local domain option to use in your application development configuration, what would be the best domain extensions to replace dev?

Since version 63 of the Chrome web browser (released in December 2017), the same force all domains ending in dev (and .foo) to be redirected to https by means of a pre-loaded HTTP Strict Transport Security (HSTS) header.

From July 2018 Firefox also started this forced redirection to the HTTPS .DEV domains.

This is a pertinent subject when developing in local environments also with Docker Laradock.

.DEV It’s a legitimate gTLD

It was bought by Google as one of its over 100 new gTLDs at this time.

The gTLD .dev has names and is basically like any other TLD out there. We, as developers, chose this name as a good replacement for local development also, overcrowding the public DNS.

Consequences of .DEV redirection for https

Many (web) developers used a local TLD. Or adding records to the /etc/hosts file or using a system like Laravel Valet, which performs a DNSMASQ service to your system to translate *.dev to 127.0.0.1.

In such cases, if you browse to http://mazer.dev, will be redirected to https://website.dev, the https variant.

This means that your local development machine needs:

  • Be able to serve the HTTPS protocol
  • Has self-signed certificates to deal with this situation
  • Add this self-signed certificate to your local trust storage (you cannot rule out self-signed certificates with HSTS, they need to be “reliable” by your computer)

As these are complex, somewhat unnecessary for the development and configuration of their local environment, I suggest a simple alternative.

How to solve

Since .dev is an official gTLD, it is probably better to change the favorite local development suffix of .dev to another.

If you are looking for a quick “search and replacement” alternative for existing settings, consider gTLD .test, which is a name reserved by IETF for test purposes (or development).

There is also an excellent proposal to add the .localhost domain as a new standard, which would be more appropriate here. It would mean that we no longer have, for example: mazer.dev, but mazer.localhost.

And everything in *.localhost would be automatically translated to 127.0.0.1, without /etc/hosts or alternative solutions dnsmasq.