Initially I set the mds.hostname in setup with something like
void setup() {
....
if (!MDNS.begin(hostString)) {
Serial.println("Error setting up MDNS responder!");
}
MDNS.addService("http", "tcp", 80);
...
}
Is it possible / advisable to change the hostname on the fly in the loop just by calling MDNS.begin again?
E.G.
void loop() {
...
if (_newHostname)
{
_newHostname = false;
if (!MDNS.begin(updatedhostName)) {
Serial.println("Error setting up MDNS responder!");
}
}
...
}