Mastodon Domain Alias

You can use your custom domain as an alias to your Mastodon handle by using Webfinger without actually having your own Mastodon instance.

On your domain, set GET https://<>/.well-known/webfinger?resource=acct:<accountname>@<server> to be the same as GET https://<>/.well-known/webfinger?resource=acct:<accountname>@<server>.

If you have a static site and don't want to set up query params, serving the same file at /.well-known/webfinger will make all usernames @<any username> forward to the same account.

Note for GitHub Pages

GitHub pages doesn't just serve arbitrary files, and won't just serve the JSON file /.well-known/webfinger without any file extension. To serve the JSON file, you can serve it at /.well-known/webfinger/index.json. You will also need to explicitly serve the .well-known folder using a _config.yml file in the root of of your repo:

include: [".well-known"]

This is based on these two guides:

Hopefully Mastodon implements BlueSky-esque domain as username features.

May be able to get around the static hosting problems using this, will need to investigate further. Or this. Or this, which Simon Willison used.

To see this in practice, search for on Mastodon.