golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.43k stars 17.71k forks source link

proposal: net: add support for "let localhost be localhost" #22826

Open mikioh opened 7 years ago

mikioh commented 7 years ago

The I-D https://tools.ietf.org/html/draft-ietf-dnsop-let-localhost-be-localhost became an IETF dnsop-wg draft. It would be better to support the feature once the I-D has been published as an RFC for the sake of convenience instead of saying "sorry, there's no direct relationship between the IPv4 loopback address prefix 127.0.0.0/8 or the IPv6 loopback address ::1 and the name localhost, that's just the convention", although the resolution for localhost still remains as a burden of applications from security perspective.

bradfitz commented 7 years ago

Can you briefly describe the proposal, or do I need to read that URL?

Are you proposing that we hard-code DNS resolution of "localhost" to always mean 127.0.0.1 or ::1?

mikioh commented 7 years ago

hard-code DNS resolution

Sort of. Simply, implementing mapping between the label localhost., and 127.0.0.0/8 and ::1 into the existing DNS stub resolver and a few tweaks such as routing ability check for 127.0.0.0/8 and ::1; routing instances may take any address in 127.0.0.0/8 as its loopback address.

bradfitz commented 7 years ago

Could you send a CL?

I imagine once it's an official RFC we'll accept it. But it would be nice to see the CL earlier.

mikioh commented 7 years ago

Will write a CL while watching Australian Open 2018, probably.

rsc commented 7 years ago

This should be put on hold until it is actually approved and has an RFC number.

mikioh commented 5 years ago

[Status report] Looks like the draft has been stalled, probably it's hard to make a consensus about pushing the draft to the next stage, IESG, perhaps because of the lack of a general solution to the problem domain. If you are waiting for the fix of this issue, it's better to find out another way. I'll keep this issue open for a while, but close at some point.