How do I setup custom domains?

You need to buy a domain first, yes.

Then you need to add the records.

This post explains how to setup a custom domain more detail.