Santiago Posted July 11 Share Posted July 11 Hello, I'm currently working on a project that requires querying a specific DNS server. Unfortunately, on Free Hosting, I'm encountering an issue where the DNS query process isn't working as expected. Here's the part o my of code I'm that is sending and recieving the socket data: $socket = fsockopen("udp://$dnsServer", 53, $errno, $errstr, 5); if (!$socket) { return "Socket creation failed: $errstr ($errno)"; } // Send the DNS query to the specified DNS server if (!fwrite($socket, $packet, strlen($packet))) { return "Failed to send data"; } // Receive the response $response = fread($socket, 512); if ($response === false) { return "Failed to receive data"; } I'm consistently receiving a "Failed to receive data" error, indicating that my script is unable to retrieve the data from the socket. Could there be any limitations or restrictions on Free Hosting that could be causing this issue? Quote Link to comment Share on other sites More sharing options...
Santiago Posted July 11 Author Share Posted July 11 I solved by using DNS over HTTPS Quote Link to comment Share on other sites More sharing options...
TinkerMan Posted July 12 Share Posted July 12 Yeah, sockets don’t really work right on free hosting. Looks like you got it working, so that’s good! Quote Link to comment Share on other sites More sharing options...
Santiago Posted July 13 Author Share Posted July 13 Yes and now Xera has ACME SSL compatibility, new version will be announced soon Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.