# Resolving Host on mDNS

**URL:** <https://community.particle.io/t/resolving-host-on-mdns/51577>\
**Category:** Libraries\
**Tags:** photon\
**Created:** [August 8, 2019, 4:03pm UTC](https://community.particle.io/t/resolving-host-on-mdns/51577 "2019-08-08T16:03:36Z")\
**Posts on this page:** 16\
**Page:** 3

<div class="post-metadata">

**Author:** ![moz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moz/32/20176_2.png) [@moz](https://community.particle.io/u/moz)\
**Post date:** [August 13, 2019, 8:25am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/41 "2019-08-13T08:25:34Z")

</div>

Ok. That does answer that.  
Another query I had is, Is it possible to copy a UDP library of another board, say EP8266, and use it as an include in my application. As I am using one of their libraries that depend heavily on lwIP which is not accessible in particle. If I make an include which will have all the necessary lwIP and the ESPUDP files, will it work or it will have massive issues due to change in platform?

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [August 13, 2019, 8:39am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/42 "2019-08-13T08:39:51Z")

</div>

> [@moz](#):
>
> Is it possible to copy a UDP library of another board, say EP8266, and use it as an include in my application.

Most likely not since the network stacks between the two platforms are entirely different and I doubt any ESP UDP library would be that hardware agnostic that it could be transferred over without a good amount of rework.

---

<div class="post-metadata">

**Author:** ![moz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moz/32/20176_2.png) [@moz](https://community.particle.io/u/moz)\
**Post date:** [August 13, 2019, 8:48am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/43 "2019-08-13T08:48:03Z")

</div>

Any other possible way to resolve a hostname on mDNS on particle photon apart from porting an ESP library and spending hours clearing all the dependencies without any guarantee it will work?  
I also thought about using the current mDNS library present in the particle and include the feature of sending and resolving QTYPE A queries but even that will require a lot of effort to understand the library and add those features at the right place. However, this seems to be the only path left for now.

---

<div class="post-metadata">

**Author:** ![moz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moz/32/20176_2.png) [@moz](https://community.particle.io/u/moz)\
**Post date:** [August 13, 2019, 9:10am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/44 "2019-08-13T09:10:21Z")

</div>

Hey is it possible to modily your serverLocater code on github and use it to send QTYPE A and resolve the host IP? Maybe we can work together and convert it into a library used just for host IP resolving?

---

<div class="post-metadata">

**Author:** ![moz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moz/32/20176_2.png) [@moz](https://community.particle.io/u/moz)\
**Post date:** [August 13, 2019, 9:52am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/45 "2019-08-13T09:52:33Z")

</div>

> [@ScruffR](#):
>
> This would be a function that emits a QTYPE A request

Where did you find this information? I am hoping to find the response part of it too so that I can make it work somehow.

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [August 13, 2019, 12:22pm UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/46 "2019-08-13T12:22:09Z")

</div>

> [@moz](#):
>
> Where did you find this information?

> **[Multicast DNS | Queries](https://en.wikipedia.org/wiki/Multicast_DNS#Queries)**
>
> The wire format for records in the query section is slightly modified from that in unicast DNS, adding the single-bit UNICAST-RESPONSE field.

> **[List of DNS record types](https://en.wikipedia.org/wiki/List_of_DNS_record_types)**
>
> This list of DNS record types is an overview of resource records (RRs) permissible in zone files of the Domain Name System (DNS). It also contains pseudo-RRs.
> Other types of records simply provide some types of information (for example, an HINFO record gives a description of the type of computer/OS a host uses), or others return data used in experimental features. The "type" field is also used in the protocol for various operations.
> Progress has rendered some of the originally defined record-ty...

---

<div class="post-metadata">

**Author:** ![moz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moz/32/20176_2.png) [@moz](https://community.particle.io/u/moz)\
**Post date:** [August 14, 2019, 11:29am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/47 "2019-08-14T11:29:51Z")

</div>

Hey, is it possible to start a service on the host on which it sends it’s current dhcp IP address so that the photon can subscribe to it and get the IP Address?

---

<div class="post-metadata">

**Author:** ![moz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moz/32/20176_2.png) [@moz](https://community.particle.io/u/moz)\
**Post date:** [August 16, 2019, 9:37am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/48 "2019-08-16T09:37:53Z")

</div>

Hey. Some new developments. While testing with the MDNS library for photon, I found that the particle is unable to join the multicast group after some time. It is working fine in the beginning but after some time it is dropping off of the group and unable to join again. Any views on why this must be happening? I have tried leaving the multicast group and joining again but to no vain.

---

<div class="post-metadata">

**Author:** ![moz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moz/32/20176_2.png) [@moz](https://community.particle.io/u/moz)\
**Post date:** [August 17, 2019, 6:08pm UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/49 "2019-08-17T18:08:03Z")

</div>

Hey. So I forgot to update here. I was able to modify an ESP8266 library for particle photon to resolve the mDNS host IPs. It takes in the host name “host1.local” and returns it’s IP on the subnet. I will post it on my github. Ping me if anyone needs it. Thank you everyone for your help.

---

<div class="post-metadata">

**Author:** ![Triodegain](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/triodegain/32/25337_2.png) [@Triodegain](https://community.particle.io/u/Triodegain)\
**Post date:** [October 19, 2020, 8:41pm UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/50 "2020-10-19T20:41:08Z")

</div>

Hi @moz, I could totally use that right now. Thanks!

---

<div class="post-metadata">

**Author:** ![moz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moz/32/20176_2.png) [@moz](https://community.particle.io/u/moz)\
**Post date:** [October 20, 2020, 7:08am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/51 "2020-10-20T07:08:16Z")

</div>

Hey @Triodegain, I am attaching the link to the github for this library. I have been using this ever since and have faced no issues with particle photon so it is pretty stable. Do let me know if you find any issues.

> **[thedim-witted/Particle\_mDNSResolver](https://github.com/thedim-witted/Particle_mDNSResolver)**
>
> A library to resolve the host IP over mDNS for the particle photon boards. - thedim-witted/Particle\_mDNSResolver

---

<div class="post-metadata">

**Author:** ![Triodegain](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/triodegain/32/25337_2.png) [@Triodegain](https://community.particle.io/u/Triodegain)\
**Post date:** [October 20, 2020, 2:40pm UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/52 "2020-10-20T14:40:43Z")

</div>

Hi @moz. Big thanks. I am connecting to an ESP32 websocket server with mDNS. I need to resolve that IP. 🙂 You are my only hope, Obi Wan.

---

<div class="post-metadata">

**Author:** ![Triodegain](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/triodegain/32/25337_2.png) [@Triodegain](https://community.particle.io/u/Triodegain)\
**Post date:** [October 20, 2020, 5:24pm UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/53 "2020-10-20T17:24:12Z")

</div>

![P1090807](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/b/1/b10a332d7ccbca1c4a6a27c6b9266867e45b0579.jpeg)  
@moz Bewm. I have my IP now. I am extending a Nextion HMI screen over WiFi websockets with an ESP32 as a websocket server for a marine power control product using a Particle P1. I will test on P1 to make sure all is well. So far it works beautifully. Again thanks.  
 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/6/8/683d501232eaaa49bd40a363340d0e6da10f370e.jpeg)

---

<div class="post-metadata">

**Author:** ![Triodegain](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/triodegain/32/25337_2.png) [@Triodegain](https://community.particle.io/u/Triodegain)\
**Post date:** [October 22, 2020, 12:04am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/54 "2020-10-22T00:04:21Z")

</div>

@moz The IP goodness continues. My Photon-based vacuum tube microphone preamp can find Node Red by name now. Double win.  
P1 install is running fine after 24 hrs, btw. Thanks. twice. 🙂

 ![P1090814](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/2/d/2d8188cf8833aba3827a2d9bf5af30944f82c22d.jpeg)

---

<div class="post-metadata">

**Author:** ![moz](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moz/32/20176_2.png) [@moz](https://community.particle.io/u/moz)\
**Post date:** [October 22, 2020, 7:37am UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/55 "2020-10-22T07:37:48Z")

</div>

Glad to see it helped you.

---

<div class="post-metadata">

**Author:** ![Triodegain](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/triodegain/32/25337_2.png) [@Triodegain](https://community.particle.io/u/Triodegain)\
**Post date:** [October 22, 2020, 1:37pm UTC](https://community.particle.io/t/resolving-host-on-mdns/51577/56 "2020-10-22T13:37:48Z")

</div>

@moz Both these projects were stalled on the greaseboard at “resolve IP” for weeks. Things can proceed now thanks to you. Bravo.

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/particle/original/3X/0/f/0f4266ebaf27e9ffc672a29b300bc7bac747e8b9.jpeg) Edit: both P1 and Photon installs have been running for 24 hrs now with no issues.

[Previous page](https://community.particle.io/t/resolving-host-on-mdns/51577.md?page=2)
