PHP cUrl is displaying a web page insted server not found.

December 24, 2014 1.5k views

Can you understand this PHP program>>

function file_get_contents_curl($url)
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (compatible;)");
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
return $data;

echo file_get_contents_curl('http:// 5w43242423424v2ic.com');

This program Should be echo 'default server not found' instead a web page.

digitalocean server is displaying a website page when i access this domain 'http:// 5w43242423424v2ic.com' via your server.

Because this domain is not available and registered.

  • What DNS resolvers are you using? Can you post the contents of /etc/resolv.conf?

  • Yes i solved this issues.

    You can add "search domain.tld" line to the file /etc/resolvconf/resolv.conf.d/head
    which is used to generate the resolv.conf file on the system during reboot.
    AFTER that reboot droplet.

Be the first one to answer this question.