I have a Mac that I joined to a Windows domain. While the machine is off the network and you connect to the terminal it shows the name of the machine as HD_MACPRO. When I connect it to the network this information changes and it thinks it is another name. This name is usually a valid Windows machine on the network. Any thoughts on the cause of this? Could it be taking the name from DNS? If so, how could I avoid this?
The name of the Mac in Terminal is not necessarily going to be the AD name. You set the AD name in Directory Utility, while the name in Terminal is likely coming from DHCP. It appears that we've solved this before:
Ensure Macs get correct machine name from DHCP?
Try the steps listed there to solve the issue.