Any ideas would be very welcome.

Any ideas would be very welcome.
I’m using mDNS to broadcast an IP address of an Esp8266 server as “esp5”
I can locate the server on my browser using “http://esp5.local” and all is fine.
However if I use client.connect(“http://esp5.local”,80) on my client Esp8266 it cannot find the server. It will locate the server with client.connect(ip address, 80)
Any ideas please?

Client doesn’t speak mDNS?

@Bunny_Evans Thank you. I had assumed because http://client.connect(“http://www.google.com”,80) was ok then using the mDNS address would also be ok also.
http://www.google.co

Have you tried using http://esp5.local:80?

@Mano_Biletsky_Open_M I’ll give it a try. Thank you

Correct me if I am wrong but for mDNS to work, both the client and the server need to speak it.

It is not like regular DNS where the client goes to the DNS server it got from DHCP and goes “Dude, where’s esp5?” and gets a response back “Y’all go looking at 10.0.0.8 ya hear.”

mDNS is more like the server going “Yoo hoo! esp5 is over here!” But the client has headphones on and is listening to AC/DC

You probably need an additional library in your client for mDNS

Perhaps.

@Bunny_Evans ​​​​​​​ I had installed library ESP8266mDNS library from github, but the example given returned “no service found” I e int N = 0 in code below.
if (MDNS.begin(hostString)) {
Serial.println(“Error setting up MDNS responder!”);
}
Serial.println(“mDNS responder started”);
MDNS.addService(“esp”, “tcp”, 80); // Announce esp tcp service on port 8080

Serial.println(“Sending mDNS query”);
int n = MDNS.queryService(“esp”, “tcp”); // Send out query for esp tcp services
Serial.println(“mDNS query done”);
I reasoned that because by browser obtained the IP address from the mDNS host string the client.connect(host, 80) method should do the same, but I think the browser is making a mDNS query.
Perhaps the mDNS library has been updated but the example has not.
Regards Brian

Now working!
I had to mess around a bit with the hostname and the line int n = MDNS.queryService(“esp”, “tcp”); does not accept individual host names but means any beginning with “esp”
Thank you for your assistance.

@Brian_Lambert Oh no. No need to thank me, I’m happy for you.