Hosting is a commodity. Move a page between services in an afternoon and nothing is lost. The address is the part that cannot be moved, unless it was yours to begin with.

This guide covers why it matters, the setup, and the two ways it goes wrong.
The address is what you cannot rebuild
Publish a link and it immediately spreads to places you cannot see.
Messages. Bookmarks. Other people's pages. Printed material. Search results. A profile you no longer maintain.
If that address is on a hosting provider's domain, all of it depends on that provider continuing to exist, to serve you, and to keep the same address scheme. When any of those changes, everything breaks at once and there is no recovery.
With your own domain, moving is a change of where the domain points. Every existing link keeps working.
This is why the domain is worth setting up before publishing an address, rather than after.
The setup
Two records at your registrar.
One for the bare domain, pointing at the host. One for the www version, pointing at the same place. The exact values come from whoever is hosting the page, and they publish them for this purpose.
That is usually the whole job. The interfaces differ, the concept does not.
| Provider's address | Your domain | |
|---|---|---|
| Survives changing host | No | Yes |
| Survives the host closing | No | Yes |
| Appears in the browser bar | Theirs | Yours |
| Cost | None | Small, annual |
| Setup | None | Two records |
Propagation is not a fault
After changing the records, the new destination takes effect over minutes to hours.
During that window some people reach the new place and some the old one, depending on what their network has cached. That is how the system works rather than something going wrong.
Do not change records repeatedly while waiting. Set them once, wait, then check.
Pick one form
Serve either the bare domain or the www version, and redirect the other to it.
Serving both means the same page exists at two addresses. Links split between them, search engines treat them as separate pages, and any counting you do is halved across two entries.
Which one you choose does not matter. Choosing is what matters, and then being consistent everywhere you write the address.

Renewal is the failure nobody plans for
A domain is rented annually. Miss the renewal and it expires.
After a grace period it becomes available to anyone, including people who register lapsed domains specifically because they still receive traffic. An address printed on your material can end up pointing at something you have no control over.
Turn on automatic renewal. Keep the payment method current. And keep the registrar login somewhere you will actually find it in two years, because it is the single account that everything else depends on.
For the surrounding ground, see Canonical URL: which address is the real one and Free HTML file hosting, compared.
Put it at an address
Register the domain before publishing the address, add the two records, pick one form and redirect the other, turn on automatic renewal, and keep the registrar details somewhere safe.
Then changing anything else about the page costs an afternoon rather than every link you have published.