-
-
Notifications
You must be signed in to change notification settings - Fork 619
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
Subdomain, Local DNS support: Don't require hosts file manipulation #416
Comments
Here some links how we do it at amazee.io: OS X has resolv.conf settings per domain, so we just set one for docker.amazee.io that then defines a nameserver to be 127.0.0.0:53: Linux has no nameservers per domain, so we just add ourselves to the /etc/resolv.conf, our nameserver will not return any requests other than on the haproxy side, we have not a full matching to the incoming domain, but match also subdomains: so far this works very well, sometimes it's a bit tricky on Linux as other systems also change the /etc/resolv.conf but restarting pygmy and with that checking the resolv.conf contents usually fixes that. |
The problem with dnsmasq and all similar solutions is that it requires intervention with the workstation of the user, and in fact reconfigures their system. Most users don't appreciate things that do that, and there are almost always unanticipated consequences, and support issues we don't want or need. I strongly recommend that we move to a legitimate resolvable domain name (like local.drud.com ?) and use wildcard DNS there. That would make it so that any user connected to the internet would immediately have a working DNS lookup and no hosts file manipulation would be required. This approach is outlined in #175. When users did not have DNS (traveling or otherwise disconnected) the traditional hosts file manipulation could be done. |
and how do you know the IP that should be resolved to? Just assume that it is localhost always? |
Yes, it would resolve to 127.0.0.1, so in the example, *.local.drud.com would resolve to 127.0.0.1 |
then I would suggest to use nip.io and not invent something new :) |
the only problem: what if the docker host is not running on localhost? |
I love the idea of nip.io (and never ever knew about it, thanks!), but
As far as docker host not running on localhost: We only support (currently) docker-for-mac and docker-for-windows, which are innately on the same machine. Linux could conceivably bite us, but we really don't have any plans to do anything more exotic than a local docker server. (I did originally test older docker versions for Windows, and was able to make them work, but we didn't ever see a need to support docker-machine and friends.) |
why? we assume it's
correct, but do you feel ready to create a DNS infrastructure that can handle the best would probably be https://tools.ietf.org/html/draft-west-let-localhost-be-localhost-06 but this will take a bit. |
|
Responding to "let localhost be localhost", thanks for that link. AFAICT, that's about the localhost names (localhost, .localhost, etc). We're not using those anywhere or in any way, just the reserved address 127.0.0.1. Maybe I misunderstood your intent with that. |
I think a wildcard itself will not be enough, you would need an
Just saying, having thousand of users all over the world using |
Along with #415, I think we may need to get on a call with all 3 of us because this doesn't feel like we're in sync and this might just be a quicker item to resolve with additional clarity. |
@rickmanelius see https://doodle.com/schnitzel and send me a meeting request, I'm in Austin (central time) currently. |
We met and now have a clear and agreed upon path to actionability. Summarizing:
|
We're now using the official Drupal 8 release here #503. We probably want to start doing the same for WordPress and Drupal 7. |
An additional need for this:
|
@beathorst to help us prioritize, can you please say why it is necessary for you to have the DNS vs /etc/hosts feature? For most people it's just an annoyance that it requires /etc/hosts to be manipulated. We were wondering if maybe you were talking about the ability to have multiple hostnames point to one project? That's in #620 and it is high priority. If that's what you're after we'd love to have you chime in there with the reasons it's important to you. |
@rfay thanx for your fast answer. |
sorry you are right it is #620 what helps me |
I suspect we're going to never do this. We're all used to the /etc/hosts manipulation, and people like it working offline. The only think we really have to do is provide a tool that will make it easier for Windows users. |
and to handle subdomains we tell people to just create the subdomains in config.yml? |
You can already do subdomains easily (they're simulated subdomains, but work fine). See the docs about additional_hostnames which gives exactly this example (subdomains for multiple languages). You can go to any level in the dotted hostnames there; they're certainly not DNS subdomains, but they behave the same from a name resolution perspective. |
So I think there is now a bit confusion, there is @rfay saying:
and @rickmanelius saying:
Can we get some clarity on this? From my side, I'm fine with not having a publich DNS and relying on
|
@wizonesolutions points out this article on not using .local - https://miketelahun.wordpress.com/2012/09/16/stop-using-local-as-the-top-level-domain-for-your-lan/ |
May I suggest an alternative approach, which I used for the drupaltrainingday event (in dutch, sorry):
This will avoid hostfile mods, doesn't require any elevated permissions and would allow the use of any domain without adding any services or overhead. |
While we didn't quite get to a public DNS lookup first before modifying /etc/hosts, we do have FQDN support, which allows both the change of naming convention as well as the ability to use public DNS records that point back. To that end, I'm suggesting we close this thread. Conversations regarding switching the default TLD pattern was discussed here and can be re-opened. The desire to default to public DNS with /etc/hosts as a fallback is still on the table, but I'm wondering if the FQDN support already makes enough inroads towards this. |
Actually, in re-reading my notes I think I vote to keep this open because we still want to address the change from *.ddev.local to *.ddev.site, which would be a prerequisite to switching out the default behavior if we proceed. |
From https://letsencrypt.org/docs/certificates-for-localhost/
|
Now that we have mkcert for trusted local https, it's not important to have a "real" certificate. That means we have plenty of flexibility here. A simple option is to
|
Summarizing the acceptance criteria in this thread:
The text was updated successfully, but these errors were encountered: