How to link a domain name to your Discord server

Set up a custom URL for your Discord server so people can join via discord.yourdomain.com or yourdomain.com/discord instead of a raw discord.gg link.