Defined in RFC-1123 (Requirements for Internet Hosts - Application and Support) and updated in 5321 (Simple Mail Transfer Protocol) to call out the removal of underscores in hostnames when specifically dealing with SMTP
- fully qualified hostnames can have a trailing dot; mail domains must never have a trailing dot
- hostnames can be unqualified (dotless), but RFC 2821 accidentally forbade dotless mail domains so they are even more of an interop minefield than you might expect
- NETBIOS hostname conventions (- forbidden, _ allowed) tend to leak into internet hostnames more than mail domains
Both are subsets of domain names. I have found it useful to be pedantic about the differences, but I have worked as a postmaster and hostmaster …