It doesn't work if the device doesn't look for local domains. It works on Linux desktops.
in the top of the sketch
#include <ESP8266mDNS.h>
MDNSResponder mdns;
in setup()
if (!mdns.begin("esp", WiFi.localIP())) {
Serial.println("Error setting up MDNS responder!");
while(1) {
delay(1000);
}
}