Apache and php don't have DNS ?

Hi,

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
file_get_contents(“http://www.google.com”)

i get an error :
failed to open stream: php_network_getaddresses

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

thanks

Howdy,

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

Hi,

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

host google.com

google.com has address 173.194.67.104
google.com has address 173.194.67.105
google.com has address 173.194.67.106

oh, i have found the fix !

in BIND’s config i had put
recursion no;

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

it works fine now

Howdy,

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!

-Eric