dancol90 / ESP8266Ping

Ping library for ESP8266 Arduino core
GNU Lesser General Public License v2.1
265 stars 136 forks source link

Pinging made up domain names also working? #34

Closed Abhesheksh closed 1 year ago

Abhesheksh commented 3 years ago

Hi,

I was trying to ping google.com, and it was working fine but then I tried pinging a wrong domain name and it still came out fine.

if(Ping.ping("www.goog32143234114le.com")){

ifdef DEBUG

    Serial.println(Ping.averageTime());
    Serial.print("Success! ");
    Serial.print(minuteBetweenCheck);
    Serial.println(" minutes");
    #endif
    vpnFails=0;       // if the ping is OK , the we reset the vpn and google fails counter
    googleFails=0;
}

Serial :

Success! Will try ping again in 1 minutes Pinging vpn Server www.google.com 1 Success! Will try ping again in 1 minutes Pinging vpn Server www.google.com 2 Success! Will try ping again in 1 minutes Pinging vpn Server www.google.com 1 Success! Will try ping again in 1 minutes Pinging vpn Server www.google.com 6 Success! Will try ping again in 1 minutes Pinging vpn Server www.google.com 2 Success! Will try ping again in 1 minutes Pinging vpn Server www.google.com 1

dancol90 commented 1 year ago

Tested by using an non-existent URL in the HostPing example. It may depend on your DNS server.