Possible to have a single instance with multiple domains?

I did a search through the Discourse and have gandered at the docs, but am not finding an answer to something: in what way, if any, can an instance of Mastodon be used with multiple domains?

I notice that the configuration docs mention LOCAL_DOMAIN, WEB_DOMAIN and ALTERNATE_DOMAINS but it isn’t clear what those env variables do, individually or in combination. If I missed that, please give me a pointer to what page(s) clarify those.

For example, presume I have multiple related domains, say, domain1.tld and domain2.tld, or more.

I’m wondering, if one can have an instance of Mastodon with two domains, such that people with @pseudonym@domain1.tld could also have at the same time, and pointing to the same profile, @pseudonym@domain2.tld (if that makes sense, and I’ve got the notation correct).

I’m assuming no, but those configuration variables make me wonder. So, I thought I’d ask, as it weighs into my thinking. If yes, what about three or four (If I were to, for example, grab domain1.social and domain2.social for the instance as well)?

I’m sure I can point multiple domains, as aliases or whatever in DNS, to a main canonical one used for an instance, but I wondered about the way the profiles work, and if they’d be interchangeable instead of one being canonical and the others merely pointers to, or that resolve to, the main one.

Thanks!

Frankly I wouldn’t do that. There are many issues with this and the domain name is not only used to reach the server over the network but also used as a permanent identity of the user.

I believe ALTERNATE_DOMAINS is for what you have said, all domains in this list are treated as aliases of LOCAL_DOMAIN.

And WEB_DOMAIN seems to be used for CDN I think.

1 Like