Moving The Blog to The New Domain

January 19, 2020 3 minutes

Yesterday I got a notification email saying my blog domain: will be expired soon. I planned to renew, however the price is quite hefty: 60 USD (around IDR 900k), double in price than my first year of renting this domain.

Since I want to keep my blog setup cost as low as possible without sacrificing many things, I excercised how easy it is to move my blog to a new domain. So, I purchased new cheap domain with only USD 3 for the first year in GoDaddy. There are 2 outcome from my experiment of migrating this blog to new domain:

  • either it is really painful and error prone process, hence I would keep paying the 60 buck to continue using domain, or
  • it is relatively easy, so it is better to use the new domain for this blog


It was super easy and quick. In fact, I managed to migrate this in 1-2 hours. The migration process basically involved few configuration changes. It also worth to mention that my blog content doesn’t have any hardcoding of the blog domain to link resources (e.g: image resources).

The Migration Process

To give you some context, I use:

  • GitHub to put my blog content, using hugo
  • Netlify to host the blog. Domain is also managed within the Netlify.
  • New domain is purchased on GoDaddy.

Transfer DNS Control from GoDaddy to Netlify

Just to be clear, the main reason why I delegate the DNS control to Netlify is to keep my life simple. Rather than managing the DNS from GoDaddy, but using Netlify to manage the blog, I’d instead choose Netlify for both.

The easy way (I would say the only way, but CMIIW) to do this is by configure the NS record of in GoDaddy to Netlify’s nameservers.

Note that this can take some times to propagate. To check it:

dig -t NS

When it is already reflected, in the ANSWER SECTION it should print out the new nameservers.

;; ANSWER SECTION:             3600    IN      NS             3600    IN      NS             3600    IN      NS             3600    IN      NS

Then, I added in Netlify domain setting so I can start configuring the DNS there.

Points to My Netlify Blog Domain

By default, Netlify will give your blog the domain. For instance, my blog domain is

So I added CNAME record of to This basically means that is the canonical name of, hence will return the same IP location

Configure Netlify Custom Domain

In order for Netlify able to route the new domain to my site, I added in the Custom Domain list. Even I set it as Primary Domain.

Change Hugo BaseURL

In the config.toml, it was set to

baseURL = ""

I changed to

baseURL = ""

Now, I can access my blog via the new domain.

However, there is one more step to properly routing someone who access my blog via old domain to the new domain.

Redirect Old Domain to New Domain

Beside setting the old domain CNAME to, I also modified Netlify _redirect file* 301!* 301!

Basically that will redirect or to my new domain.

That’s it. Quite easy right :D


comments powered by Disqus