A free address such as yourname.github.io or yoursite.netlify.app is fine for experiments, but a custom domain like yourname.dev looks professional, is easier to remember and stays yours even if you move to another host. Buying one takes minutes; connecting it takes a little understanding of DNS, the system that turns names into server addresses.
How domain names work
Computers find each other by IP addresses such as 192.0.2.10. Humans prefer names, so in 1983 Paul Mockapetris designed the Domain Name System, a worldwide distributed directory that translates names into addresses. The first .com domain was registered in 1985, and since 1998 the nonprofit organisation ICANN has coordinated the system.
Three players are involved when you buy a domain:
- Registry: the organisation that runs a top-level domain (TLD), for example Verisign for .com.
- Registrar: the company that sells you the domain, such as Namecheap, Porkbun or Cloudflare.
- Registrant: you. Strictly speaking, you do not own a domain forever; you rent it for one to ten years at a time and must renew it.
Step 1: choose a good name
A good domain is short, easy to spell after hearing it once and free of hyphens and numbers that people forget. Say it aloud to a friend and ask them to type it.
Next, choose the ending. .com is still the most familiar, but good names there are scarce. Country codes such as .de, .ge or .ua signal a local audience, while .dev, .io or .app suit developers and projects. Note that .dev and .app require HTTPS in every browser. Some country domains have residency rules.
Step 2: pick a registrar and compare real prices
Use a registrar accredited by ICANN or by the national registry. Prices for a .com are typically 10 to 20 US dollars a year, but look carefully at these points:
- Renewal price: a cheap first year often renews at double or triple the price. Compare the renewal price, not the offer.
- Privacy protection: it hides your name, address and phone number from public WHOIS lookups. Most good registrars include it free.
- Upsells: you rarely need the bundled email, website builder or "SEO" packages offered at checkout.
- Premium domains: some short names are labelled premium and cost hundreds or thousands of dollars, sometimes every year.
Step 3: buy and secure the domain
After paying, secure your account right away, because whoever controls the account controls your website and email:
- Turn on two-factor authentication for the registrar account.
- Enable auto-renew and keep a valid payment card on file. Expired domains are quickly bought by others.
- Check that the registrar lock (transfer lock) is on, so nobody can move the domain without your approval.
- Use an account email that does not depend on the domain itself, so renewal warnings still reach you.
Step 4: understand the DNS records
Connecting a domain means adding DNS records in your registrar's dashboard, or at a DNS provider such as Cloudflare. The most common types are:
- A: points a name to an IPv4 address, for example @ to 192.0.2.10. The @ sign means the bare domain itself, called the apex.
- AAAA: the same for an IPv6 address.
- CNAME: makes one name an alias of another, for example www pointing to yourname.github.io. A CNAME cannot be used on the apex.
- MX: tells the world which server receives email for the domain.
- TXT: holds text, used to prove domain ownership and for email security records such as SPF.
Each record also has a TTL (time to live), the number of seconds other servers may cache it.
Step 5: connect the domain to your host
Your host tells you exactly what to add; follow its current documentation. There are two common methods:
- Change the nameservers: you hand the whole DNS zone to the host, for example Netlify or Cloudflare. You then manage all records, including email, there.
- Add individual records: keep DNS at the registrar and add the A or CNAME records the host gives you. This is the usual way for GitHub Pages or Vercel.
A typical setup is an A record for the apex and a CNAME for www, with the host redirecting one to the other. Then enter the domain in the host's settings, where you may also need to add a TXT record to verify ownership.
Step 6: wait, test and enable HTTPS
Changes usually work within minutes, but caches can take up to 48 hours to update, especially after a nameserver change. Check your records with an online DNS lookup or nslookup yourdomain.com in a terminal. Once the domain points correctly, most hosts issue a free Let's Encrypt certificate automatically. Turn on "Enforce HTTPS" so every visitor gets the secure version.
Common mistakes and legal notes
- Leaving old records: a parked-page A record left next to the new one sends some visitors to the wrong place.
- Breaking email: when you change nameservers, copy the MX and TXT records first.
- Forgetting renewal: an expired domain can be taken over and used for scams with your old visitors.
- Ignoring trademarks: registering a name that copies a brand to sell it or profit from it is called cybersquatting. The owner can take the domain through the UDRP dispute process or the courts.
Get these basics right once, and your domain will serve you for years.