I have a seemingly common issue.
When checking the hostnames with scutil --get ComputerName and it's LocalHostName and HostName commands, the HostName is not always set. As such, the hostname tends to be set to some random name.
Is there a command I can use that will automatically match the HostName to a ComputerName or LocalHostName variable? I'd like to push this out remotely in bulk over ARD.