When using Arduino 1.8.13 and esp8266 2.7.4 boards version, I got success whenever pinging outside of my local network. If I replaced "google.com" with some outlandish URL, I invariably got success. I updated to the latest Arduino1.8.19 and esp8266 3.0.2 and everything started working. I was using a Wemos D1 mini and modifying the example "HostPing".
If you get stuck with the library seemingly not working, try updating your IDE and boards/libraries. I hope that this might help someone avoid the lost time that I suffered.
When using Arduino 1.8.13 and esp8266 2.7.4 boards version, I got success whenever pinging outside of my local network. If I replaced "google.com" with some outlandish URL, I invariably got success. I updated to the latest Arduino1.8.19 and esp8266 3.0.2 and everything started working. I was using a Wemos D1 mini and modifying the example "HostPing". If you get stuck with the library seemingly not working, try updating your IDE and boards/libraries. I hope that this might help someone avoid the lost time that I suffered.