Resolve “Warning: fsockopen() function.fsockopen]:php_network_getaddresses: getaddrinfo failed: Name or service not known”

Getting the following PHP error with fsockopen(): Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known.

In addition, there is another line of error:
Warning: fsockopen() [function.fsockopen]: unable to connect to api.search.yahoo.com:80