So you're a Noob? Post your questions here until you graduate! Don't be shy.

User avatar
By tjoepie
#82085 Hello forum,

I'm new to esp8266 and the arduino world. I tried running the MQTT example from Example sketch: PubSubClient\mqtt_esp8266 on my ESP-01 hardware. I was able to connect, but unable to resolve any hostnames that ends with .local in the name. The code works as one would expect, when I set the mqtt server value to an IP value instead of a hostname. Also note, that I am on a different subnet to where my MQTT Server is running. My host machine where the Arduino IDE is running, is able to resolve the MQTT Server's name, due to it getting the correct DNS server from DHCP, that allows to resolve the names. So I know it works.

When reading on the GitHub https://github.com/esp8266/Arduino/issues/2373, it seems that this post started the problem of what I'm experiencing, which is, any hostname that ends with .local is ignored and a person is now forced to use mDNS. But I'm just wondering, how would mDNS work if you are on a different subnet, and my local DNS server is still willing to hand out the IPs.

Is there a way, to force WIFI.hostByName to ignore .local and not make a distinction between, e.g. www.google.com and myhost.mydomain.local, similar to pre library esp8266-2.4.2?

Thanks in advance!