Machine name set to new-host-X instead of the name set in Preferences [duplicate]

My machine name is set shiny in System Preferences/Sharing/Computer Name.

From another machine on the network, I can only use shiny.local to refer to this machine. In the past, I used only shiny.

In a terminal, I have new-host-7 instead of the machine name.

I don't know if this is relevant, but the computers are connected to an internet box, on which a DHCP server is activated. I assigned a static IP address to the Mac. The internet box can see the name I gave to the Mac.

Is there something I can do to refer to the Mac as shiny on the network ?


Solution 1:

Try using sudo scutil --set HostName shiny and sudo scutil --set LocalHostName shiny then close your shell (Terminal window) and open a new one.

Solution 2:

I figured it out here - (the scutil command is nice to know but didn't work)

Access your router (usually 192.168.1.1 or something) and look for the list of devices. On my Verizon Router this is under "My Network." You should be able to rename them there.

The problem I found was that my computer had two different IP connections to the router: one was the ethernet, the other was the wireless connection. The wireless connection had the correct name, the other one had "new-host-5". You can't have the same name for both, so rename the wireless connection to whatever, and then change the name of the ethernet connection to what you want. (Also I just disabled the Wireless connection, because I don't need both... Don't know if that was necessary though) Hope This helps!