macOS renaming itself...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-14-2023 04:44 AM
We use a script to rename our Macs along the lines of DA-%SERIALNUMBER%
For the last year or so, around half of our estate (I expect those using our campus network) regularly renames itself along the line of DA-FVFHF4BGQ05F (6), the suffix number incrementally increases and we have some devices with hostnames that end (533) or greater. This obviously looks a total mess.
I don't fully understand why this happens, nor how to prevent it - I presume it relates to the device wanting to avoid a duplicate name on the network, which in our case would only be itself, so it's confusing why it happens at all. WIndows isn't affected in the same way. I suspect the ultimate fix would be something at network level, but wonder if anyone knew the root cause, or had dealt with this via macOS config and/or Jamf?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-14-2023 12:53 PM
Do any of these devices happen to use multiple connection types? For example Wi-Fi and an Ethernet adapter on the same network? I've seen instances where it can cause a hostname conflict.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-17-2023 05:56 AM
Hi Patrick, thanks for this. Upon investigation, it does appear that all Macs affected are using both ethernet and wifi... is there anything configurable in MacOS to ignore this hostname conflict?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-17-2023 06:13 AM
I don't think there's a way around this behavior, but I set up an EA to check if the hostname was valid, and if not, rename the Mac once a week.
Happy to provide both but we name our systems to S/N so it might not be too useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 09-05-2023 01:00 AM
Hey Jrant, would you be able to provide me with that script as well? We're seeing the same issue in our environment.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 07-17-2023 07:16 AM
Thanks, jtrant - sounds useful, could you send over your script?
