Macs on my windows Network show up as a Windows Computer name, instead of their actual Computer names.

Stubakka
Contributor II

Hello all, I work in a 98% Windows Environment , We have about 15 macs in the whole Organization (Marketing groups). I have been here about a year and this issue still haunts me and I can't seem to figure out why its happening. Basically in the nutshell, any Mac system, even newly configured as of about 4 months ago fresh out of the box shows up on the network as a windows computer name. This has become so much of an issue here that before I was hired, they created Mac specific VLANS that the Macs would be assigned to so they just were with each other on the network. I have never seen this kind of issue before at other companies I worked at that were also heavy windows environments. But alas, With everyone working remotely currently I see this issue as an even bigger eye sore because the Macs are connecting to VPN with all the PC users and I get Gems like this where multiple of them show up in ARD after I Add them via IP address with Computer names to PCs. When Im on the systems they show the correct computer name in terminal and even running commands to flush DNS etc don't resolve this issue. Does anyone have an idea what could be causing this on the DHCP or DNS servers themselves? I am pretty sure we have Leases that last about 18 hours before expiring. Any tips, ideas things to try are welcome

8 REPLIES 8

macbrun
New Contributor III

I have seen this, or a similar issue where I work. Let me ask a few questions:
Are the Macs showing up as the name of an existing Windows computer? For example you have a Mac named "Mac123" but it appears as one of your existing PCs named "WinXYZ"?
Are you using Active Directory?

For us it started when we stopped binding our Macs to AD.

Are the Macs bound to it?

chase_g
New Contributor III

I ran into a similar issue where our Macs were showing in our McAfee ePO console as random windows computer names when they were connected to VPN.

What I ended up finding out is that when our Macs connected to VPN they were getting assigned a WINS NetBIOS Name of a windows computer when looking at the network settings on the Mac(Network>Wifi>WINS tab). Going to terminal and running hostname -f would return that same Windows host name. Once I disconnect from VPN and check those same settings they go back to being my computer name and stop showing the windows names. I don't know if it was our VPN or DNS that was doing this, but it seemed to me the random windows name it was assigning was whatever windows computer possibly had that DHCP address the last time. Since one day the mac would report one name, and a different name a day or two later.

After testing and looking at a few different Macs I found that ones who had their Computer Name, Host Name and Local Host Name set did not experience this issue. But ones that only had Computer Name set, and blank/no setting for Host Name & Local Host Name were affected. You can check if you have those set in terminal by running: scutil --get ComputerName/HostName/LocalHostName.

Ultimately I resolved it by having a script to set the Computer Name/Host Name/Local Host Name on all Macs and they stopped reporting with windows names. The script I used just ran scutil to --set each of those to our standard naming convention. Hope this helps

Stubakka
Contributor II

@chase.garcia Can you share this script with me and did you just deploy it as a policy to managed systems with some wild cards ? Our Macs are intact bound to AD. Over VPN they report windows computer names , in the office they have their own VLAN so the issue is not as glaring, but when they are connected to the same networks as windows PCs they show the incorrect names. The naming convention here is just MACSerialnumber (very creative I know lol) so like mine is "MACC02Z60VPLVDZ"

Stubakka
Contributor II

@macbrun Thanks for the reply , yes they are bound to AD and yes they show up as current or even OLD computer names that are no longer even in us. Im actually wondering if this is an issue with DNS itself, and maybe we don't have aging or Scavengining enabled on DNS like described here. Im looking into all options.

chase_g
New Contributor III

@Stubakka Here is the script I use to set our computer names. We just use serial number so you would have to edit it to add your prefix. check-and-set-proper-computerName-host-localhost.sh

jtrant
Valued Contributor

I've seen this multiple times, and it's always stale DNS and/or scavenging not configured/broken.

Stubakka
Contributor II

@jtrant I think this is the issue also... trying to convince my Networking team

dlondon
Valued Contributor

Hi @Stubakka

For me this means that in one of our many DNS servers for various domains there is an entry for the machine with that "windows" name. As you see this problem at your machine with ARD (as do I), open terminal and try a nslookup on the machines IP address. If it returns the funky name you know where the problem is. Then send the results to the team that looks after the DNS. If they are good they will thank you for showing where they have some old records.

From memory there are about 3 or 4 different places in the mac that the name can be set. The simplest way of doing it for me has been with the jamf binary i.e. jamf setcomputername -name but it doesn't sound like that's the problem - you're getting the name from an external source and my bet is on DNS

Regards,

David