Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advice on) your project See About the Installation & Troubleshooting category.
Is mDNS support enabled on your PC? Is your PC in the same broadcast network as the ESP? Is device isolation disabled on the WiFi access point (router)?
so how are you pinging ? anyway i always have a webserver set up rather than just 'pinging' and then in my browser i type
http://esp8266.local/
and particularly that forward slash at the end seems to be relevant.
mDNS can be a bit funky on routers though, and at times it loses the relevant information and needs a reset of some kind (usually i lose file sharing between devices at the same time)
What OS does you PC run? As far as I know Windows doesn't support mDNS on the command line (only in the browser) but I don't have that OS to check. If you run Linux ensure the avahi daemon is running, then mDNS should be supported.
There is a known bug in the example code you are using. The author has been notified on github but has apparently chosen to not update their published code.
You need to add the following line to the loop() { } ; section of the code : MDNS.update();
void loop() {
MDNS.update();
}
Once you do that. it should start working. And without that there is not way to get it working.
Adding this comment for anyone following and searching for a solution to this same problem.