Are you sure? I'm a Mastodon newbie, but the docs suggest neither the "local domain" nor the "web domain" can be changed once set:
> As with LOCAL_DOMAIN, WEB_DOMAIN cannot be safely changed once set, as this will confuse remote servers that knew of your previous settings and may break communication with them or make it unreliable.
> As with LOCAL_DOMAIN, WEB_DOMAIN cannot be safely changed once set, as this will confuse remote servers that knew of your previous settings and may break communication with them or make it unreliable.
https://docs.joinmastodon.org/admin/config/#local_domain
They also recommend a "301 Moved Permanently" implementation.