ESP8266 mDNS

This tutorial explains how to Multicast DNS using ESP8266? In networking world it is difficult to remember ip address of each website and computer, to solve this problem Domain Name System (DNS) is used to make human understandable names. In ESP8266 when using ESP as web server, It is difficult to remember ip address of ESP8266 and also it is difficult to identify ip address of ESP in DHCP mode. i.e. WiFi router assigns IP address to ESP8266. Most ESP8266 application doesn’t have display interface and they are not easy to access to know its IP address. To overcome this problem mDNS is used.

What is mDNS?

for more information on mDNS read RFC6762

As networked devices become smaller, more portable, and more ubiquitous, the ability to operate with less configured infrastructure is increasingly important. In particular, the ability to look up DNS resource record data types (including, but not limited to, host names) in the absence of a conventional managed DNS server is useful.

Multicast DNS (mDNS) provides the ability to perform DNS-like operations on the local link in the absence of any conventional Unicast DNS server. In addition, Multicast DNS designates a portion of the DNS namespace to be free for local use, without the need to pay any annual fee, and without the need to set up delegations or otherwise configure a conventional DNS server to answer for those names.

The primary benefits of Multicast DNS names are that

  1. They require little or no administration or configuration to set them up,
  2. They work when no infrastructure is present, and
  3. They work during infrastructure failures.

Using mDNS in Local Network on ESP8266

Program for mDNS using ESP8266

This program creates ESP8266 mDNS with name esp8266 MDNS.begin(“esp8266”)

After uploading this program open serial monitor to see everything is fine.

Then open web browser and enter esp8266.local in address bar. Make sure your esp and the laptop (NOT ANDROID PHONE)  on which you are opening web browser use same WiFi network.

DNS system have www.xyzabc.com like names. but when you use mDNS that is local DNS system does not have any DNS server. you have to enter domain name after that dot(.) local. ex. esp8266.local

esp8266 mdns
ESP8266 mDNS

Important Note: Android OS does not support mDNS. You have to use IP address in mobile phone. To solve this problem, display IP address in web page. so that you can get ip of ESP8266 on your laptop.

 

One thought on “ESP8266 mDNS

Leave a Reply