All Macs are automatically given a Computer Name. This can be changed in the Sharing system preference pane, and typically is something like John’s iMac.
When joining a Mac to Active Directory, it is critical that this Computer Name be cleaned up first. In order for the AD binding and services to function as expected, the Computer name must be less than 16 characters, and only contain alphanumeric (A–Z, a–z), numbers (0–9), – (dash) and/or _ (underscore) characters.
Spaces and apostrophes are not valid, however these are two characters used by default by OS X when automatically sets the Computer Name. See this Apple support article for more information: https://support.apple.com/en-gb/HT203193
Also of note: This Apple support article also states that the Active Directory domain that the Mac is being joined to should not include an underscore in it’s name.