I know you only asked about the domain but I landed here with the same question in the context of the same-origin policy. The port is included in the same-origin policy.
"...the same-origin policy performs string matching on the protocol, domain, and port. Two websites have the same origin if their protocols, domains, and ports all exactly match."
Sources:
CS161 Textbook
RFC6454-section-3.2.1