Open SteveRMann opened 6 months ago
I've been looking for a "nslookup" type command for the ESP32 to work around this, but hostname is the correct solution.
Looks like this is already supported anywhere you would be setting an IP, just set the domain instead.
https://github.com/knolleary/pubsubclient/blob/master/src/PubSubClient.cpp#L118-L127 https://github.com/knolleary/pubsubclient/blob/master/src/PubSubClient.cpp#L715-L719
I need to move my MQTT server to a new IP. The reason why is irrelevant. If I could use the MDNS location for the broker in client.setserver(), a change in my broker IP would be trivial.
Instead of client.setServer("192.168.1.120", 1883);
I would like to be able to: client.setServer("broker.local", 1883);