4 ms·
Why couldn't they just redirect "localhost" at the DNS level to 127.0.0.1?
by pmarreck 9y ago
Why couldn't they just redirect "localhost" at the DNS level to 127.0.0.1?
- deleted 9y ago[deleted]
- 0xCMP 9y agoWell, because that IP isn't what localhost is supposed to be pointed to. It's supposed to point at 127.0.0.1. The IP you mentioned is more likely to be the IP of the router you're connected to. Usually 127.0.0.1 is limited to the computer's internal network via a loopback network interface and `localhost` should be resolving just to that, but this RFC makes it so that no matter what `localhost` will point locally instead of somewhere else which helps people who want to bind to just the internal loopback and nothing else.
- wolfgang42 9y agoFor context, as the parent has edited their post: the original question was asking why localhost couldn't have a DNS entry for 192.something.
- acdha 9y agoTrust: there's no “DNS level” which you can reason about reliably across the wide range of networks people use. Developers would still get bug reports because some ISP resolved localhost to the IP address of their search / ad page, or a dodgy home router returned its setup page, etc. Lest that seem contrived, there are major ISPs – national level in Europe – which ran transparent HTTP proxy-caches which stored pages for years beyond their expiration date. I have zero confidence that some ISP wouldn't through incompetence or marketing have localhost resolve to something you don't expect. Building it into the network stack means that entire class of errors stops happening.
- fundabulousrIII 9y agooh, screw off. Run your own servers and mandate your configurations for search and acceptable servers or go tsig and penalize your providers. this isn't hard. In fact for a scalable|good business it should be mandatory.