Intent to Deprecate and Remove: Special handling of localhost.localdomain host

Skip to first unread message

Frédéric Wang

Dec 12, 2020, 11:38:12 AM12/12/20
to blink-dev

Please find below my intent to remove special handling for "localhost.localdomain" host name. This intent is very similar to the localhost6 and localhost6.localdomain that I sent earlier. The reason why I sent this separately is that contrary to localhost6 where a rough regex search on HTTPArchive essentially led to 0 matches, similar search for localhost.localdomain has an upper bound of 0.000009% pages corresponding to potential real usages.

So while for now my CL at just removes "localhost.localdomain", it's possible that we want to be more careful (introduce a pref flag, use counter, etc) before unshipping. I'm welcoming suggestions from API owners on that point.



Contact emails




API spec


Design docs


Currently, host name "localhost.localdomain" resolve to the loopback addresses ::1 and, bypassing native DNS, and corresponding origin is treated as secured. The goal of this entry is to remove this non-standard behavior.


Standards describe an optional resolution of the "localhost" host name and trustworthiness of corresponding origin [1] [2]. Users have complained about inconsistency between Chromium (which implements the spec), Firefox (which only implemented it recently) and WebKit (where patches are being submitted). Hopefully things can be make consistent and the specification a bit stricter. However, Chromium also has similar but non-standard behavior for "localhost.localdomain". Removing this would help to make things more predictable for users.

Blink component


TAG review

TAG review status

Not applicable


Interoperability and Compatibility

This will improve interoperability since there is no specification defining this behavior and no plans in WebKit/Firefox to implement it. There is a potential risk to break websites relying on these host names. It seems this was implemented ten years ago, motivated by existing DNS resolution in some Linux distributions. Public usage seems relatively low (see detailed analysis below). People willing to continue to treat localhost.localdomain specially for local development or specific systems can still configure native DNS. Chromium also implements a special allow list as permitted by the specification:;l=43;drc=bf799475f9ff40b7e1e2be2fd3a68911c4f047ee

Gecko: No signal ( Firefox implemented the specification for "localhost" but not the non-standard value "localhost.localdomain" which was never discussed.

WebKit: No signal ( There is not an official position, some Apple people have expressed interest for implementing this "localhost" resolution (currently native DNS on macOS/iOS don't do that), others had concerns about allowing websites to access localhost addresses and so make them trustworthy. Introducing "localhost.localdomain" would only make harder to reach a consensus, while Chrome making a step towards the spec / other browsers could be appreciated.

Web developers: Positive Developers were positive about making Firefox/WebKit more interoperable with Chrome (see corresponding bug reports).

Detailed analysis:  Performed on BigQuery's response_bodies.2020_10_01_desktop, based on about 218315452 urls of HTTPArchive.

Pages containing a quoted string with localhost.localdomain were extracted  (more precisely, those matching the regexp r"[\"\'`][^\"\'`]*(?:localhost.localdomain)[^\"\'`]*[\"\'`]") and 8334 urls were found (for a total of 8746 matched strings).

- 6533 of them contains a match of the form globalStorage["localhost.localdomain"] (corresponding to an API from Firefox < 13) the remaining cases represent less than 0.000009% of the original set.

For the remaining cases:
- 895 contain a match corresponding to an array of localhost names like "localhost","localhost.localdomain".
- 675 contain a match corresponding to a fallback expression like ||"localhost.localdomain".
- The remaining cases represent ~0.000001% of the original set.

If you search in the chromium source you'll find various matches
but often they just seem to be used as illustrative purpose or a default placeholder than implying a real semantic.


This is reducing the scope of "potentially trustworthy" so making security stricter.

Is this feature fully tested by web-platform-tests?


Tracking bug

Link to entry on the Chrome Platform Status

This intent message was generated by Chrome Platform Status.

Frédéric Wang

Mike West

Dec 14, 2020, 11:21:35 AM12/14/20
to Frédéric Wang, blink-dev
LGTM1, for the same reasons as the `localhost6` intent. The risk here is not different in kind, and I expect the success of one is as likely as the success of the other.


You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Dec 15, 2020, 2:07:43 AM12/15/20
to blink-dev,, blink-dev,


Chris Harrelson

Dec 17, 2020, 3:24:30 PM12/17/20
to, blink-dev,,
Reply all
Reply to author
0 new messages