microsoft / devhome

The new Dev Home experience for Windows!
https://aka.ms/devhomedocs
MIT License
3.65k stars 327 forks source link

local wildcard dns to localhost #3924

Open webartoli opened 1 month ago

webartoli commented 1 month ago

Suggested new feature or improvement

I would like to register dns names with wildcard; something like

# ipv4
*.localhost   127.0.0.1
*.*.localhost 127.0.0.1

# ipv6
*.localhost   ::1
*.*.localhost ::1

Scenario

As a developer I need to have several services running locally. A typical use case is to point to localhost on different port and is messy.

In a microservices environment, a local application gateway is in place.

So having a tool that can alias localhost with different fqdn is awesome. Something like: api.myproduct.localhost, myproduct.localhost, domain.myproduct.localhost.

Having multiple FQDNs on localhost also allows https, with tools like mkcert

Additional details

Chromium based browsers already do this. *.localhost just points to 127.0.0.1 on those browsers because that is a big need.

Some public services are available out there like localtest.me that perform this thing but there are several drawbacks.

It requires internet connection local development in train/metro/boat should be an option

It may conflict with other network/security tools Some enterprise gateways and general purpose routers like AVM FritzBox have a built-in DNS Rebind Protection that cannot be disabled by wildcard.