Actually, the "use dynamic global hostname" is NOT checked and it's still having this behavior.
under system preferences -> sharing, If i turn off remote management, the name in terminal is correct.
As soon as I turn on remote management, the name displayed is wrong.
So how does the mac get it's computer name from DNS, as I'm trying to figure this out.
after looking in DNS, I noticed the IP address of my mac is 192.168.102.115, which is a DHCP IP.
In the forward lookup zone, this IP has the correct name of admins-mac-mini
In the referse lookup zone, this IP points to a different name,udzyndra, which is not correct. The name in the reverse
lookup zone is listed numerous times over and over. The computer udzyndra is actually a windows PC, so not sure why most of my macs are using this windows name.
Is it safe to just delete all entries in my reverse lookup zone?
I tried setting the DHCP client ID, but that didn't.
If I use static IPs on my macs, then this issue doesn't happen. I think there's a total of 13 or 14, I was mistaken earlier about the total number of macs, so I really want to use DHCP on all of them.
serialband, I can see this happening to one mac, but it's happening on EVERY mac.
Very strange, I will try what yo suggested.
serialband,
So I ran those commands and now when I go to system preferences -> sharing, it doesn't list the computer name there anymore, but IP address. I guess it kind of helped, since the wrong computer name is not there, but the problem is, it's now an IP address and I need it to use a computer name, as it's much harder to remember to remote desktop into computers by IPs rather than names.
Anything else I can try?
I figured out the exact problem, I just don't know how to solve it.
When a MAC is using DHCP, it does NOT update the DNS forward zone records
DHCP is working fine, when a MAC gets an IP lease, the correct computer name is listed in DHCP
It does try to use the DNS entry listed in the Reverse lookup zone
If a record with the IP address it has is already in there, it will use that DNS name in the remote sharing section and in terminal
If a record for the IP it's using is NOT in the reverse lookup zone, it will just use it's IP address in the remote sharing section and in terminal
DNS has been verified, in the reverse lookup zone, by default the setting is enabled "update associated pointer (PTR) record"
The MACs just don't update the PTR record, they only read it, so they will use it if it's in there, but will not update or add an entry
Does anyone know any good vendors that work with MACS and Windows in the Sacramento, CA area, as I think it's time for me to call a company to come research the issue.
thanks guys for your help
Open System Preferences
Select Sharing.
Click on the Edit button just under the Computer name field.
Make sure the check box for Use dynamic global hostname is unchecked.
Instructions here also: https://knowledge.autodesk.com/search-result/caas/sfdcarticles/sfdcarticles/Setting-a-persistent-hostname-on-a-Mac-workstation-that-uses-DHCP.html