Apache and php don't have DNS ?


in my website, i’m getting information from another site with curl_url and curl_exec functions.
On Virtualmin it doesn’t work because it seems not to be able to access DNS to translate the url

same with

i get an error :
failed to open stream: php_network_getaddresses

what can i do to allow my php/apache to get url resolved ?



You may want to make sure that DNS resolution is currently working on your system.

For example, what output do you get when running this command:

host google.com


everything works when i’m in console
only php seems to be unable to resolve dns

host google.com

google.com has address
google.com has address
google.com has address

oh, i have found the fix !

in BIND’s config i had put
recursion no;

now i have put :
recursion yes;
allow-recursion {;

it works fine now


Hmm, well that’s unusual! I’m surprised that worked from the command line, but not from Apache/PHP.

However, I’m glad you found the fix, thanks for sharing that!