DNS error #231
Replies: 42 comments
-
|
Beta Was this translation helpful? Give feedback.
-
I think this has something to do with how ReactPHP resolves the dns, as this is implemented in PHP as well. |
Beta Was this translation helpful? Give feedback.
-
I agree that this error message is somewhat confusing and doesn't provide the necessary information. That's why I've filed reactphp/socket#230 a few weeks ago in the underlying component to improve error reporting. I'm planning to release this in the next couple of days if everything goes according to plan. This should give us much better insights to see what's going on. In the meantime, you can also try installing this component from |
Beta Was this translation helpful? Give feedback.
-
@clue I just sent a test build with dev-master to someone that can reproduce the problem. Here's the result:
But pinging the host works just fine for him:
|
Beta Was this translation helpful? Give feedback.
-
@mpociot Thanks, this makes it much easier to debug:
This means the client side can't connect to the DNS server, so this is likely a system configuration or firewall issue. Perhaps you can try running one of the included DNS examples here: https://github.com/reactphp/dns/tree/master/examples This is very close to what's being used internally by the socket component. We're not aware of any issues in our DNS component and these examples should work out of the box. If it doesn't work on your system, you can also try checking the |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
@clue Thanks, adding 1.1.1.1 dns works for me. Then i remove this dns let only google's dns and still works. I'm in Brazil, maybe was some slow dns propagation. |
Beta Was this translation helpful? Give feedback.
-
Running the first example from https://github.com/reactphp/dns/tree/master/examples returns this:
|
Beta Was this translation helpful? Give feedback.
-
@themsaid Thanks for providing this exception trace. Can you file an issue in the upstream repo https://github.com/reactphp/dns with some details about your platform (PHP version, OS, We're not currently aware of any issues in our DNS component and people have been using this on a wide variety of platforms for years, so I'm really curious what could cause this issue. The only thing I have in mind might be if your system has a broken DNS configuration (primary DNS broken, but secondary DNS works), this is not currently implemented (reactphp/dns#6). In the meantime, you should be able to work around this by explicitly defining another DNS server like given above. As an alternative, you can also temporarily add an entry to your
Expose will also somehow use a $connector = new React\Socket\Connector($loop, array(
'dns' => '127.0.1.1'
)); |
Beta Was this translation helpful? Give feedback.
-
@clue I was talking with @themsaid about this today and he was able to fix this. I think the best way to fix this in the Expose codebase, is to give users the ability to manually override/configure the DNS server that should be used when connecting. |
Beta Was this translation helpful? Give feedback.
-
@mpociot I don't agree that Expose should have explicit DNS configuration by default. Any application should take advantage of the system configuration and just work. If your Adding explicit DNS configuration options could be useful in some more advanced scenarios, but this probably shouldn't be the default. In particular, Expose should not override the system settings by default because the system DNS configuration could configure a company-internal DNS server which resolves different addresses than a publicly available one such as Couldflare's or Google's (let alone possible privacy implications). I'd really like to understand what's causing this problem as it clearly seems to affect multiple users. We just need some more information and a fix probably shouldn't be too hard 👍 |
Beta Was this translation helpful? Give feedback.
-
Those are good points against having it configurable @clue :) We will probably need some more input from @themsaid then. |
Beta Was this translation helpful? Give feedback.
-
@themsaid I have no idea what's the causing the issue :) Could be the ISP indeed :) |
Beta Was this translation helpful? Give feedback.
-
In the cases where this problem is occurring ... If so, then sometimes explicitly configuring to use 127.0.0.1 as the primary DNS service is helpful. dnsmasq does honor But with dnsmasq I would suggest not editing resolv.conf but instead to edit the dnsmasq settings (with Valet you can put custom configs in |
Beta Was this translation helpful? Give feedback.
-
I also experienced this issue right now on expose Could not connect to the server.
Connection to sharedwithexpose.com:443 failed during DNS lookup: fwrite(): send of 38 bytes failed with errno=65 No route to host |
Beta Was this translation helpful? Give feedback.
-
Now its back with the error... Could not connect to the server.
Connection to tls://sharedwithexpose.com:443 timed out after 20 seconds |
Beta Was this translation helpful? Give feedback.
-
Yes...IPv6 is the problem. |
Beta Was this translation helpful? Give feedback.
-
Can confirm disabling IPv6 resolves this :( |
Beta Was this translation helpful? Give feedback.
-
Can someone help me reproduce this? My
So it's using an IPv6 DNS, but I'm still able to connect to Expose. It would be great if someone with this issue could try the following:
This updates the internal ReactPHP component dependencies, so maybe this fixes it for you? As I can't verify the fix, I could use some help. |
Beta Was this translation helpful? Give feedback.
-
I tested but it gives me the same error:
|
Beta Was this translation helpful? Give feedback.
-
If I change the order of DNS and set the IPv6 to be the last in the
to this:
|
Beta Was this translation helpful? Give feedback.
-
@mpociot It's actually only not working when IPv6 or DNS over IPv6 is improperly configured, be it by the user or more probably the ISP. At that point the problem I discussed above with @clue kicks in. ReactPHP doesn't try a second DNS server if the first doesn't work (while the OS does and people don't notice their IPv6 DNS config is borked). Just my wild guess after doing some testing on this.. |
Beta Was this translation helpful? Give feedback.
-
TLDR: Send a couple of sponsors my way (https://github.com/sponsors/clue) and I'm happy to solve this. 💸 This requires a feature addition in @reactphp which Expose builds on top of. Expose does not need any changes once this is built into @reactphp. Here's a recap of what's going on:
Here's what needs to be implemented in @reactphp to make sure this error no longer shows up even when people have invalid nameserver entries:
As you can see, this is a non-trivial amount of work. I've layed out this plan to show this is very much actionable and could be solved in a couple of days. As much as I'd love to work on this, I won't be able to commit to this right now: I'm rather busy working on a bunch of others projects at the moment. Perhaps we can find a couple of new GitHub sponsors to allow me spending some time on this? Put your money where your mouth is? 💸 |
Beta Was this translation helpful? Give feedback.
-
@clue BTW I had the same problem in PHPStan Pro and I solved it by hardcoding the DNS server to 1.1.1.1 for everyone. Can you think of any downside with this approach? Do you think that someone can have this server blocked by their corporate firewall or something? |
Beta Was this translation helpful? Give feedback.
-
@ondrejmirtes Yes, this can be problematic. Hard-coding a public DNS server as the primary DNS server might be an option for some use cases (which is why this is indeed supported by @reactphp). This was briefly discussed in #25 (comment):
As per #25 (comment), some public DNS servers are also blocked in some more restrictive legislations (think country-wide blocks / firewalls implemented at the DNS level). From a developer's perspective, I think this could perhaps be the more important reason why DNS fallback servers should be supported in ReactPHP itself:
|
Beta Was this translation helpful? Give feedback.
-
@clue I see, it's funny how me and @mpociot had the same train of thought - I planned that if it turned out that I'm kind of used to that people's systems are broken in all kinds of ways, so it's better not to rely on it. For example in one instance the client crashed because the user had some non-sense in the But I'll trust you on this one :) |
Beta Was this translation helpful? Give feedback.
-
@clue Do we have issues for all of this on the respected @reactphp repositories for tracking? P.S. I'd be happy to pick those up, but it's not super high on my own priority list, like @clue says a one or more sponsors can help with that. |
Beta Was this translation helpful? Give feedback.
-
I got the following error as others
Then looking through the above i did the following as others recommended @chiribuc thanks edit my
to
and all run ok. |
Beta Was this translation helpful? Give feedback.
-
I have face similar issue. It was working before (weeks ago) but now it doesn't work. Am i doing something wrong? |
Beta Was this translation helpful? Give feedback.
-
Using |
Beta Was this translation helpful? Give feedback.
-
while running
expose share
this the error i am getting
Could not connect to the server.
Connection to sharedwithexpose.com:443 failed during DNS lookup: DNS error
Beta Was this translation helpful? Give feedback.
All reactions