New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ddev's management of /etc/hosts file could use one line per host, instead of putting all on one line #2817
Comments
First, most people don't use the hosts file at all any more, they use *.ddev.site, which doesn't require mucking with the hosts file. But I can see your use case. But I definitely wish that the library we depend on did one line per host. /etc/hosts alteration is little-used now though, so not likely to change. |
Hello, OS: MacOS Big Sur DDEV appends all local hostnames on my Mac in /etc/hosts in one line. Currently, I have the problem that new hosts will not startup. "Network not reachable" while trying to access the new project in browser. I haven't count the local projects, but it could be ~300 *.ddev.site hostnames. I found a very old issue ticket where a limitation of 4K each line takes affect: For now I have remove some hostnames from the one-liner to get the project started. Stefan |
Hi @froemken - You must have a Fritzbox router I guess, or some other network situation that denies DNS rebinding, but usually it's Fritzbox routers. You'll be much happier with things if you fix that, see https://ddev.readthedocs.io/en/latest/users/basics/troubleshooting/#dns-rebinding-prohibited |
Note that Windows 11 doesn't seem to have the 10-hosts-per-line problem any more. |
Is your feature request related to a problem? Please describe.
It's not really a problem, more likely an improvement for a faster work flow.
Describe the solution you'd like
Currently,
ddev
produces entries in/etc/hosts
like this:Which are a few steps more if you'd like to go the production site instead of your local machine. The background:
Great online shop systems like Shopware have licensed plugins to a fully qualified domain and they only run in the local instance, if the domain entry matches the fqdn in
/etc/hosts
.To make life easier, so for simple commenting out, it would be better to have one fqdn assignment to
127.0.0.1
like i. e. vagrant with the pluignvagrant-hostmanager
does on the host machine. It wraps each written entry in an uuid block comment like this, so that the program can clearly identify its written entries based on that vagrant's start id (vagrant generates an hash on eachvagrant up
command, which is directly dumped out from that host manager plugin):Describe alternatives you've considered
Running a local dns server in the LAN like
dnsmasq
, but it's even much more complex and for most developers not really considerable.Additional context
None
The text was updated successfully, but these errors were encountered: