How to prevent machine from renaming itself at start up

For what it's worth, I had this exact same problem and also need to have both wifi and ethernet enabled on my iMac. It started after upgrading to Mojave, my router is an Asus RT-AC88U and had until Mojave been fine. After the update I started getting the message in macOS about a duplicate computer name on my network and my computer changed it's name from "iMac" to "iMac (2)" - but within a few days is was up to "iMac (2000)" and kept rising.

Spoke to Apple, they suggested deleting the wifi adapter and re-adding it in Mojave which didn't fix it. The only other thing they suggested was a rebuild of macOS from scratch.

I tried all the other fixes suggested everywhere, disabling wifi (not good as I also want to be able to unlock my mac with my apple watch) - but the problem does go away, renaming network locations, rebooting router, delete and re-add ethernet and everything else I came across. I also had the smart wifi option enabled on the router to combine the 2.4G and 5G SSID in to a single name broadcast (the router then assigns devices to the correct band) - it was suggested this might also be a problem so I put the router back to 2 different SSID's for the different bands. Nothing fixed the issue.

Then I realised that my ethernet adapter had a fixed IP address that I gave it but the wifi adapter was on DHCP. I had also reserved the fixed IP address on the router for ethernet but not wifi. So I reserved the 2 addresses I wanted for both adapters on the router and then set them to DHCP on the iMac. I also made sure that the Advanced settings for the IP address had a different DHCP Client ID name specified just to be sure.

So far so good, the iMac hasn't changed it's name in a few days now.


Recommend you try following in Terminal to make your windowlick static

sudo scutil –-set HostName new_hostname

sudo scutil –-set LocalHostName new_hostname

sudo scutil –-set ComputerName new_hostname

The problem is you have a multi-homed host on the same network; two simultaneous network connections.

It has a reserved IP address for its wired Ethernet port, but it connects via both Ethernet and Wi-Fi (which does not have an address reservation).

There's no reason to do this.

Disconnect your WiFi (IMO) wired is better. Reboot and your host name should stick.

You can't have the same host name for different adapters on the same network. If windowlick.local had two IP addresses on the same network, which IP would it go to if you issued a ping windowlick command? This is why it automatically renamed the hostname.

However, you can have the same hostname on different subnets. For example, WiFi was on the 192.168.1.0 network and Ethernet was on 192.168.2.0 network..