DEV Community


Posted on

Obtaining and Using Domains


If you watch youtube you have probably seen countless sponsors for buying a domain.

Up until recently I really didnt feel a need to, but after making my Personal Site, I felt like it would be nice to have a proper domain instead of

While this can be followed like a tutorial, it assumes you already have a site on github pages, and only gives exact directions for domains bought through Google Domains.

Thinking of a name

I thought of this last night in my sleep, I woke up with the excellent idea of buying It would be a double win, I have a fun URL and a intresting topic for blog.

I dont recommend this strategy:

  • sleeping is an unreliable method for brainstorming
  • you should have more reason for buying and making a website than
    • I thought of in my sleep
    • it would work well for a blog post

For example, if you arent using github pages to host, you should probably look into if your domain will require a SSL certificate, because not all hosts will provide one.

Trying to find where to buy it.

google search of buy domain

I went to the top 6 results that looked like they were actually selling domains, looked up, and noted their prices.

Store Price
Bluehost unavailable
MailChimp unavailable
GoDaddy $20 (for the first year) $15 + $9 privacy upsell + scare tactics for removing upsell
Google $12
NameCheap $13

This made Google the clear winner, but it may not be as clear cut for you.

In your own search, some of the other services may look cheaper, but will have a big asterisk of "(for the first year)" meaning they will charge more per year afterwards.

I would avoid because, if they are willing to scare you into an upsell, what other hidden garbage are they going to throw at you. Try avoiding sites with privacy upsells in general, Google provides the same privacy protection features by default, without charging any extra.

Linking a github pages site to a url you own

Is it Possible?

Before I buy, I want to check if its even possible to do this, because I dont want to have to also start paying for a server to host stuff.

Here are the docs on this exact thing, they are pretty indepth, so yeah, it looks like this is indeed a thing you can do. They basically immediatly require you work with your DNS Provider*, so there is no testing the waters before you buy your domain.

* For clarification, DNS Provider here is Domain Name Service Provider, which for me is Google Domains

While checking out, I got a warning about .dev domains requiring SSL certificates.\
Looking into this, its brutally simple to set up SSL certificates when using github pages

Step 1: setting up the your DNS

Once you have bought your domain, go into the DNS settings in the website you bought your domain from.

Then, create an A record that points your domain, for example: or to the following ip addresses:
Enter fullscreen mode Exit fullscreen mode

You will also what to create a CNAME record that points your domain, with www this time, for example, or to <user>, for example

If your DNS Provider asks you to enter in your own TTL, it will be how long in seconds a user's pc's will remember where your domain points.\
If you arent doing anything fancy, you should just set this to the biggest value that your domain provider suggests, for example 21600 seconds, or 6 hours.

This is what my finalized entries looked like in google domains:\

Here is me running a dig command for my site, displaying the correct output\
dig +nostats +nocomments +nocmd

Step 2: configuring the github side of things:

Go to the source code repository for your github pages site, Go to the settings of your repo:\

Click into the pages tab:\

Scroll down, type in the domain you bought into the "Custom Domain" box, and click save\

Wait for a little bit, if it says "DNS check successful", then you are done!\

Step 3: wait it was that easy?


Custom Email Address

Now that I own it should be pretty simple to set up a custom email like

Google actually offered me this at checkout of the URL:\
screenshot of google's custom email options, not really intersting stuff

I probably wont do this because google seemingly treats their premium users worse.

[EDIT]: Email Forwarding

Thank you for commenting about this!

Setting it up is super simple too.

Top comments (2)

ravavyr profile image

I would recommend you use google domains to buy and then wait 3 months and transfer the domain to to make it cheaper, plus use cloudflare for caching/cdn purposes as well. has free apps [similar to netlify/heroku] and you can deploy 3 for free.

cicirello profile image
Vincent A. Cicirello

You can set up email addresses that forward to your existing email for free with Google Domains. For example, I have such an email address forward configured that forwards development@mydomain to my real email account. I use it for things like packages I've published to Maven Central and PyPI where an email contact is necessary but where I don't want my real address publicly displayed on the web. The address that looks departmental helps avoid spam as well (spammers scraping email addresses prefer individuals). Google allows a rather large number of such email forwarding addresses for free.