Webthings, Arduino code and mDNS

As I do not fully understand all aspects of the Arduino wethings code, I have a question…

if an Arduino coded webthing (ESP32 core) has mDNSHostname defined, say it is called “alarmups”, and we enter it into the setup code through;

#define MDSN_HOSTNAME "alarmups"  // in secrets.h
char mDNSHostname[] = MDSN_HOSTNAME;  // in the main code
adapter = new WebThingAdapter(mDNSHostname, WiFi.localIP())

why is it that,

http://alarmups.local

is not valid, and,

http://192.168.5.116

is.

Pointers to help me better understand this would be most welcomed. I have read through and tested code from several sites that provide examples, and these seem to work, although not webthings code, but don’t provide a clear explanation as to why webthings can’t.

Adding webthings to the gateway via an mDNS name would be so much easier than having to locate via IP address.

Thanks.