How to access webserver on ESP8266 by URL instead of IP address?

Hello all,

I'm looking for a way to access the webserver of my ESP8266 with a browser from Windows and Android, using an easy URL instead of the IP address while the ESP is connected to my WiFi network in station mode. I want it to be accessible by an URL like "mydevice.local" or something similar, so that users don't have to find out the IP address and type it into the address bar of the browser.

I've tried a few things, but nothing seems to work in all cases:

1.) Using mDNS (ESP8266mDNS.h, default example):

  • Works in station mode
  • Works native on Mac/iOS and Linux (from what I read, not tested)
  • Works on Windows if I install Apple Bonjour
  • Does not work on Android - is there any workaround like Bonjour for Windows?

2.) Using a DNS Server (DNSServer.h, default example)

  • Works on all systems
  • ... but only as access point, not in station mode

Is there any way to achieve this with the ESP8266?

Thanks :slight_smile:

Is there any way to achieve this with the ESP8266?

Yes, install a DNS server on your home server and configure it to server your own local domain. Then configure the IP of your ESP8266 to a hostname in that domain and reconfigure your router to announce your own DNS ans the DNS server for the network.

The other option is to convince Google to include support for mDNS into Android but I'm quite sure the first option is easier to realize.

pylon:
Yes, install a DNS server on your home server and configure it to server your own local domain. Then configure the IP of your ESP8266 to a hostname in that domain and reconfigure your router to announce your own DNS ans the DNS server for the network.

Yes, this would be an option for my own home network, but I guess I should have made this clearer in my first post: I need this to work in any/most home networks without requiring the user to know about how to configure routers or networks.

pylon:
The other option is to convince Google to include support for mDNS into Android but I'm quite sure the first option is easier to realize.

Well, I could try to e-mail Larry Page about this, but I think you're right regarding the chance of success :wink:

Any other ideas?

Thanks!

Any other ideas?

You might have to refine your specification. Does it have to work in any browser on any device? Do you control the app on the Android device?

The general solution is not possible (any browser, any device), so you might have to adapt your requirements.