When organizing the previous article, it was discovered that there are currently only two video bloggers who have released videos on how to bind a custom domain name and enable CDN acceleration for a Blogger blog. These videos are from Tech Lion's video and Tech KKK's video, but no text version tutorial was found for use. Text-based tutorials have their disadvantages and advantages, so for the convenience of readers, this text version tutorial has been organized and edited for reference by those who need it.
1. Prerequisites#
- You can log in to the Blogger backend and make blog settings.
- One custom domain name.
- One Cloudflare account.
2. Setup Steps#
If you want to use Cloudflare to host a custom domain name and accelerate a Blogger blog, it involves the Blogger blog, custom domain name, and Cloudflare's DNS and CDN functions. The specific steps are as follows:
(1) Bind a custom domain name#
Blogger assigns a subdomain ***.blogspot.com. Using a subdomain has its advantages, namely not worrying about domain name pollution or attacks, but its disadvantages are also quite obvious, namely the subdomain is not personalized enough and not conducive to SEO and brand image construction. For SEO optimization, you can refer to the article "Blogger SEO Optimization Top Ten Techniques" on Moonlight Blog here.
If you want your Blogger blog to have an independent domain name, you can customize an independent domain name in the Blogger backend. For the settings of a custom domain name, you can refer to the official tutorial from Blogger. It should be noted that the official tutorial does not consider all user requirements. For example, if we register a domain name in a foreign domain name registrar such as Namecheap (or Namesilo), but the domain name resolution is hosted in Cloudflare, then the domain name binding steps are as follows:
- Purchase a domain name. Purchase a domain name from Namecheap, such as igengdu.com.
- Domain name resolution settings. Usually, domain name registrars also provide DNS resolution, but relatively speaking, Cloudflare's DNS resolution is faster and more stable. The steps to set the DNS resolution of Namecheap's domain name to Cloudflare are as follows:
2.1 Register/login to your Cloudflare account and add a website, which is the domain name you just registered, igengdu.com.
2.2 At this time, Cloudflare prompts you to modify the DNS resolution of the domain name registrar to the DNS resolution values assigned by Cloudflare (such as linda.ns.cloudflare.com and John.ns.cloudflare.com, where the prefix ns.cloudflare.com represents a male and female name respectively).
2.3 In the domain name igengdu.com on the Namecheap website, find the DNS settings and set the DNS to custom DNS and fill in the DNS values provided by Cloudflare, such as linda.ns.cloudflare.com and John.ns.cloudflare.com.
- Bind the domain name to the Blogger blog. At this point, you can refer to the operating steps in the official instructions.
3.1 In the Blogger backend, add a custom domain name in the "Custom Domain" section. Note that Blogger does not support binding to a naked domain name, so you need to bind a subdomain, such as www.igengdu.com or blog.igengud.com.
3.2 Complete the CNAME verification for domain name ownership. After adding the custom domain name www.igengdu.com in step 3.1, an error will be prompted, indicating that two records need to be added under the domain name hosting place (i.e., igengdu.com where Cloudflare is located): one is the blog CNAME record, which is CNAME www ghs.google.com (if you choose to bind the Blogger blog with blog.ingengdu.com, it should be CNAME www ghs.google.com), and the other is the secure CNAME, such as CNAME da2g3f5gfhsw gv-56bedjfijdf56d-dv.googlehosted.com. It is important to note that when filling in the blog CNAME record, select "DNS only" for the last option to disable the CDN function represented by the small yellow cloud. After the domain name binding is completed, if you want to keep it concise, you can delete the secure CNAME setting.
3.3 Wait for Blogger to verify and after the verification is successful, you can access your Blogger blog using the custom domain name.
Due to the inconvenience of image settings, images are not inserted in the above content. If you need image instructions, you can refer to this article.
(2) Website access acceleration settings#
1. Enable the small yellow cloud, that is, enable the Cloudflare CDN function.#
Change the "DNS only" status after the blog CNAME record to "Proxy" to enable the CDN. The indicator that the CDN is enabled is when the small yellow cloud is lit. Note: Only after the domain name is verified and a custom domain name is bound can the CDN function be enabled. Otherwise, the Blogger blog may not be able to find the address of your blog.
2. Add the available IP addresses for the Blogger blog.#
The official IP addresses for ghs.google.com are:
- 216.239.32.21
- 216.239.34.21
- 216.239.36.21
- 216.239.38.21
Although these IP addresses can only be pinged in some parts of China, my settings are to add all of them to the A record of ghs.google.com. That is, after the domain name igengdu.com hosted by Cloudflare, add the following A records:
A @ 216.239.32.21
A @ 216.239.34.21
A @ 216.239.36.21
A @ 216.239.38.21
At the same time, query the IP addresses of ghs.google.com, including IPv4 and IPv6, through websites such as dnslookup.online and add them to the A record of igengdu.com. For example, add:
A 142.250.80.83 ghs.google.com
A 142.251.40.179 ghs.google.com
AAAA 2607:f8b0:4006:821:0:0:0:2013 ghs.google.com
AAAA 2607:f8b0:4006:80c:0:0:0:2013 ghs.google.com
(3) Other settings for the blog domain name#
1. Enable HTTPS.#
It is recommended to enable HTTPS and HTTPS redirect in the settings of the Blogger backend. Enabling HTTPS can ensure the security of the website, and enabling HTTPS redirect means that when HTTP://igengdu.com is entered, it will be redirected to HTTPS://igengdu.com.
2. Enable domain name redirect.#
If domain name redirect is enabled, entering igengdu.com will display the website as https://www.igengdu.com. Since the domain name bound to my Blogger blog is www.igengdu.com, I have set up domain name redirect for the convenience of search engine crawlers. If you bind the domain name as blog.igengdu.com, the domain name redirect will redirect the website to https://blog.igengud.com.
3. Other settings in Cloudflare for the domain name.#
3.1 Domain name SSL/TLS settings#
Under the igengdu.com domain name SSL/TLS settings, set it to "Full" or "Full (Strict)". At the same time, set the edge certificate to obtain a free 15-year SSL service for the domain name.
Firewall rules#
3.2 Under the security options, you can set simple firewall rules. For example, if you want to block access to the blog from a certain country, you can create a rule in the WAF: Filed: Country, equals, country name; take action as "Block".
3.3 "Network" settings for the domain name.#
It is recommended to enable IPv6 compatibility and gRPC.
3. Completion#
At this point, you can use Cloudflare to host a custom domain name and accelerate your Blogger blog. Especially when you enable IPv6 network services, accessing a Blogger blog with a bound IPv6 address will be faster.
Note: This article was originally published on January 17, 2024, and can be archived here.