Test with the IP address first. If that works, the problem is only the name lookup.
What the message means
mDNS lets devices find each other by a name ending in .local. Support differs between systems, and some networks block it.
Fix it in this order
- Call MDNS.begin(“name”) after Wi-Fi connects and check that it returns true.
- Open http://name.local/ and, if that fails, open the IP address to confirm the server works.
- Check that your computer supports mDNS. Install the service software on older Windows if needed.
- Some routers and guest networks block multicast traffic.
- Use a fixed IP address or a router reservation as a simple alternative.
Why it happens
Multicast DNS works by sending name questions to a multicast address on the local network, and the device that owns the name answers. Your phone or PC must support that protocol and the router must pass multicast between devices. Many guest networks and some mesh systems block it. The ESP32 can be fully connected and serving pages while none of this name traffic gets through, so the IP address still works.
Name resolution and IP routing are separate steps. Your device first turns a name into an address, then connects to that address. A failure in the first step looks like the board is offline, even though a direct request to its address succeeds. Because the ESP32 receives its address from the router through DHCP, the address can change after a reboot. Reserving a fixed address in the router avoids chasing a moving target.
If you see this, do this
| You see | Do this |
|---|---|
| IP works, name does not | mDNS support or blocked multicast. |
| Neither works | See the web server page. |
Confirm the fix
- Print WiFi.localIP() after connecting and open that address in a browser; a working page confirms the server runs without mDNS.
- Check that MDNS.begin returns true in the serial output; a false result means the responder did not start.
- Ping your-name.local from a computer terminal, then ping the IP address; if only the name fails, the problem is name lookup.
Common mistake: Readers often assume that a failing .local name means the ESP32 has crashed or lost Wi-Fi, when the board may be fine and only name lookup is blocked on that network.
Related
web server not reachable, Wi-Fi will not connect.
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.
Why this happens
Multicast DNS lets a device answer questions about its own name without a DNS server. A computer asking for robot.local sends a UDP packet to the multicast address 224.0.0.251 on port 5353, and the ESP32 replies with its address. That only works when the computer has an mDNS resolver and the network delivers multicast packets between the two devices.
Support differs. Windows 10 and later resolve .local names, macOS and Linux generally do with Bonjour or Avahi, and phones vary by app and browser. Some routers filter multicast, and a guest network or access point with client isolation blocks device-to-device traffic. The page then fails by name but succeeds by IP address, which is the sign this is a name lookup problem.
How to confirm the cause
- Print WiFi.localIP() and open that address. If the page loads, the server is fine.
- Check the return value of MDNS.begin(). A false value means the responder did not start, usually because Wi-Fi was not connected yet.
- From a computer, run ping robot.local. If it fails with unknown host while ping by IP works, the name lookup is blocked or unsupported.
- Test from a second device on the same Wi-Fi. If one device works and another does not, the fault is in the client.
- Turn off any VPN on the computer and test again, since a VPN can capture name lookups.
Worked example
This code starts the responder after the connection is up and advertises a web service on port 80.
#include <WiFi.h>
#include <ESPmDNS.h>
// after WiFi.status() == WL_CONNECTED:
if (!MDNS.begin("robot")) {
Serial.println("mDNS failed");
} else {
MDNS.addService("http", "tcp", 80);
Serial.println("http://robot.local/");
}Use lowercase letters, digits and hyphens in the name. The .local ending is added by the responder, so do not include it in begin().
Common mistakes
- Calling MDNS.begin() before Wi-Fi has connected.
- Putting .local inside the name passed to begin().
- Using spaces or underscores in the name.
- Giving two devices the same name on one network.
If this did not fix it
- Router isolates clients: turn off AP or client isolation, or use a normal network instead of a guest network.
- The address changes after each reboot: set a DHCP reservation on the router.
- Browser forces a secure address: type http:// explicitly for a plain server.