fsockopen()无法连接到www.google.com:80

I am having some problems using fsockopen() or file_get_contents() function

$test = fsockopen("www.google.com", 80, $errno, $errstr, 30);

return me

Warning: fsockopen(): unable to connect to www.google.com:80 (Connection timed out) 

Registered Stream Socket Transports tcp, udp, unix, udg, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2

allow_url_fopen = On

i am running on php7-fpm + nginx vps and can't get it working..

UPDATE Making a fsockopen to an ip address works...

this is my etc/resolv.conf

nameserver 213.133.99.99
nameserver 213.133.100.100
nameserver 213.133.98.98

UPDATE curl -vvv http://www.google.com respond

* Hostname was NOT found in DNS cache
*   Trying 2a00:1450:4001:811::2004...
*   Trying 216.58.214.68...
* Connected to www.google.com (216.58.214.68) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.38.0
> Host: www.google.com
> Accept: */*
>
< HTTP/1.1 302 Found
< Cache-Control: private

thanks

Based on your comment on the previous answer, it sounds like either your IP has been blocked by Google, or your DNS settings are broken.

What happens when you try curl:

$ curl -vvv http://www.google.com/

If it's a DNS issue it should work to access the IP directly:

$ curl 64.233.162.99

If none work, try another site, like:

$ curl -vvv http://www.stackoverflow.com/

What OS and VPS are you running?