You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Requests to localhost are handed to DNS resolver #11
This is actually a bigger issue when working with linked containers in Docker.
Explanation:
In Docker, when a link is created from one container to the other, for example from a php container to a db or service container, then the (dynamic) ip & hostname for that target container is written into /etc/hosts, Since the DNS resolver does not honor /etc/hosts, the lookup fails. Somehow the hosts file (in any system) should be respected.
One solution would be to implement a HostsExecutor and a FallthroughExecutor, combining these you would be able to have proper hosts file functionality, if you want it.
Activity
steverhoades commentedon Nov 13, 2014
@andig Can you please provide a test case for this? That will help us in replicating / resolving the issue.
andig commentedon Nov 14, 2014
Sure:
Gives (Windows):
Either the DNSresolver should honor the
hostsfile or the client should not pass local requests to the DNS resolver- dunno which is better...frankmayer commentedon Apr 15, 2015
Hi there. Is there any solution planned for this? It bit me today (Using docker containers) 😄
frankmayer commentedon Apr 15, 2015
This is actually a bigger issue when working with linked containers in Docker.
Explanation:
In Docker, when a link is created from one container to the other, for example from a php container to a db or service container, then the (dynamic) ip & hostname for that target container is written into /etc/hosts, Since the DNS resolver does not honor /etc/hosts, the lookup fails. Somehow the hosts file (in any system) should be respected.
WyriHaximus commentedon Apr 28, 2015
There is an issue about this on on the DNS component: reactphp/dns#10
Since I'm also working on the filesystem component we should look into using that to resolve this 👍 /cc @clue
frankmayer commentedon Apr 28, 2015
BTW, I found a temporary workaround, for the docker problem, using "dnsmasq" and described it in my blog.
itcreator commentedon May 29, 2015
+1 for docker
clue commentedon May 31, 2015
Big +1 for getting this in, both for convenience ("localhost" etc.) and for Docker containers!
This depends on upstream components (see reactphp-legacy/socket-client#35 which in turn depends on reactphp/dns#10) and for now there's little we can do here.
filsh commentedon May 5, 2016
I used it
http://php.net/manual/en/function.gethostbyname.php
SamMousa commentedon Sep 13, 2016
One solution would be to implement a
HostsExecutorand aFallthroughExecutor, combining these you would be able to have proper hosts file functionality, if you want it.