Not necessarily – there are some activitypub instances without hostname, directly on IP addresses, and there are even some running in private DNS roots.