\( \newcommand{\P}[]{\unicode{xB6}} \newcommand{\AA}[]{\unicode{x212B}} \newcommand{\empty}[]{\emptyset} \newcommand{\O}[]{\emptyset} \newcommand{\Alpha}[]{Α} \newcommand{\Beta}[]{Β} \newcommand{\Epsilon}[]{Ε} \newcommand{\Iota}[]{Ι} \newcommand{\Kappa}[]{Κ} \newcommand{\Rho}[]{Ρ} \newcommand{\Tau}[]{Τ} \newcommand{\Zeta}[]{Ζ} \newcommand{\Mu}[]{\unicode{x039C}} \newcommand{\Chi}[]{Χ} \newcommand{\Eta}[]{\unicode{x0397}} \newcommand{\Nu}[]{\unicode{x039D}} \newcommand{\Omicron}[]{\unicode{x039F}} \DeclareMathOperator{\sgn}{sgn} \def\oiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x222F}\,}{\unicode{x222F}}{\unicode{x222F}}{\unicode{x222F}}}\,}\nolimits} \def\oiiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x2230}\,}{\unicode{x2230}}{\unicode{x2230}}{\unicode{x2230}}}\,}\nolimits} \)

Notes on purchasing custom domains.

Buying a new domain

I recommend using https://porkbun.com/ to purchase a new domain.
They are a US registrar based out of Oregan.
In my experience, their website is very clean and intuitive and their prices are typically cheaper than Namecheap.
Other registrars typically have low initial prices but high renewal prices.
If you want you can buy from some other registrar and transfer to Porkbun, but the effort typically isn't worth the few dollars in savings.

In general, I recommend buying a .com, .net, .info, or .org domain. The renewal costs for these are only $8-11 per year.
Furthermore, you'll be able to transfer these to Cloudflare Registrar after 60 days where you'll enjoy even cheaper renewals.

If you just need a custom domain for an API, you can look into 6-9 digit .xyz domains. These domains renew for only $0.99 per year[1] and are targeted towards IOT devices.

Setup

I recommend using Cloudflare to manage your DNS. They have a very useful free tier.

Records

A

A records point to an IP.

CNAME

CNAME records point to an IP of another domain.

MX

MX records are for handing email.

TXT

TXT records are typically used for domain verification.

References