Does anyone know what could cause my Mac (macOS 11.6.4) to 'spontaneously' change its hostname from the normal setting (say, mycomputer
) to what looks like some kind of UUID (of the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
where each x
is a hex digit)? I've seen when the normal computer name gets a number appended, like mycomputer (2)
, but this looked completely different.
I first noticed it when I saw that the prompt in Terminal had changed from the usual username@mycomputer ~ %
to username@xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ~ %
Running hostname
in Terminal returned xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.fritz.box
(my router is a FRITZ!Box)
However:
- System Preferences > Sharing > Computer Name: still showed
mycomputer
- The FRITZ!Box router itself still showed
mycomputer
and notxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
in the list of devices on the network (and I couldn't see anything obvious in the router's logs about any changes) - Trying to
ping xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
orping xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.fritz.box
did not succeed, whileping mycomputer
did.
I wondered if the hostname had been changed to the UUID and then already changed back to the original mycomputer
(which could be why everything looked normal in the bullets above), but new Terminal windows still showed the UUID as the hostname.
In the end, clicking on System Preferences > Network > Ethernet > Advanced... > Renew DHCP Lease seemed to fix it. The hostname changed back to mycomputer
in the Terminal prompt and the output from the hostname
command changed back to mycomputer.fritz.box
.
Although everything seems back to normal now, I've never seen this before. I am curious about what might have happened (and whether I need to be concerned). Does anyone know?