NetBIOS name

New Contributor

I am very new to managing apple computer, or even using them for that matter. We are running 32 IMAC's on a windows domain. I am still learning how to use Casper and have re imaged from an external hard drive. Until i learn Casper better its what I know how to do. The problem is my computers that I have imaged have lost their Binding with the domain every 30 days. I have noticed that All of the IMACs have the same NetBIOS name and I cant get them to change. Does anyone know how to fix this or if it's even the cause of the problem?


Valued Contributor II

/usr/bin/defaults read /Library/Preferences/SystemConfiguration/ NetBIOSName will tell you what the name is.

sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/ NetBIOSName NAMEYOUWANT will set it.

Not sure if you're familiar with scutil to set the HostName/LocalHostName/ComputerName...

/usr/sbin/scutil --get LocalHostName
sudo /usr/sbin/scutil --set LocalHostName NameYouWant

Then you could use:
sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/ NetBIOSName $(/usr/sbin/scutil --get LocalHostName)

Oddly having NetBIOSName issues even though our network guys tell us that NetBIOS isn't an issue, yet security is asking us about weird named computers that we don't have listed having. THIS ^^^ worked!!! Thank you Robert!

New Contributor

Thanks I'll try it out

New Contributor II

A little clarification - there are three "names" applied to Macintosh OSX computers.

Using the command "scutil", they are defined as: HostName = the Unix name for the device (under Server, this should be a fully qualified domain name) ComputerName = the Mac OS name for the device (the name broadcast on the network) LocalHostName = the "zeroconf" network name for the device (a.k.a. - Apple's "Bonjour" protocol)

The JSS uses the ComputerName for most of its operations. This is also the source of the Active Directory NetBIOSName (usually reduced to all lower case during binding). Should be limited to 15 standard ASCII characters if joining Active Directory.

If you use the "scutil" command to rename the device, you should sett ALL three names to the same value.

The Mac OS tends to link the LocalHostName to the ComputerName if you change the ComputerName in System Preferences:Sharing.

New Contributor

I can the commands and it did change the NetBios name but after rebooting it reverted back to what it was before I changed it.
I used:

/usr/bin/defaults read /Library/Preferences/SystemConfiguration/

sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/ NetBIOSName NAMEYOUWANT
and then I even tried:

sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/ NetBIOSName $(/usr/sbin/scutil --get LocalHostName)

And both had the same results, They appeared to work but the after reboot they changed back.



If you have an "Update Inventory" policy make sure your Maintenance payload doesn't have the "Reset Computer Names" checked. This can cause your computer names to get reverted back at specific times depending on the frequency you run the policy.

Just something to check


New Contributor

Thanks Chuck,
I checked and no "reset computer names" was not checked.

New Contributor II

Perhaps you should try this:

  1. Unbind from Active Directory

  2. Run the following terminal commands on the target computer: sudo /usr/sbin/scutil --set HostName NameYouWant sudo /usr/sbin/scutil --set LocalHostName NameYouWant sudo /usr/sbin/scutil --set ComputerName NameYouWant

  3. Restart the computer and verify the name has been retained using the "scutil --get" command.

  4. Recon the computer using Casper Suite:Recon; or "sudo jamf recon"

  5. Re-bind the computer to Active Directory.

New Contributor

The NetBios name will revert to whatever it is getting from a PTR record even if the LocalHostName is changed using scutil. This is probably a bug, but unfortunately that means DDNS used by Windows machines can mess up NETBIOS advertisements on Mac. Particularly if a VPN connection is involved since macOS doesn't seem to register the IP address over DCE/RPC properly so you can't fix this by binding to the domain. You basically end up with the Mac advertising a stale DDNS record for another machine. I haven't found a way around this.

New Contributor

This is what I observed as well. We used a fairly agressive policy to update netbios names from all configurations files and they keep resetting. Even if we update them on the computers manually.

Did you figure out a different solution ?


New Contributor

Thanks eclemens, That worked out perfectly for me