In a previous post, we discussed how to set DNS records on Namecheap and redirect non-www traffic to the www domain name. We’ll provide a step-by-step guide on how to do it on

1. Topology

Our website is still hosted on an AWS EC2. Our DNS registrar is

EC2 (public IP a.b.c.d) —- (DNS registrar)

2. Add A Record for www on Porkbun

Hover your mouse right under your domain name until DNS and NS appears. (IMHO, this design is so weird.) Then, click DNS.

Choose Type A – Address record; host as www. The answer is your EC2’s IP address, which is a.b.c.d in our example. Then, click Add.

3. Redirect Root Domain & Subdomains on Porkbun

Click Details of your domain name.

Then, click Edit to edit URL Forwarding. Conceptually, URL redirect is also called URL forwarding. Porkbun happens to adopt URL forwarding on its website.

Leave the hostname blank to forward the root domain to your www domain. Use wildcard URL forwarding to forward all subhosts, such as, to You’ll also need to toggle the advanced setting to choose ‘Permanent Redirect (301)’.

After clicking ‘Submit’, you are good to go.

4. Summary

Conceptually, we have done a similar configuration on Porkbun and Namecheap. However, how Porkbun configures redirects is very different from Namecheap, which might cause some confusion. Please always consult the official document for the best reference.

Ultimately, I recommend and if you are in the market to shop for a domain name. About 70% of the time, I’ve found that has the best price considering the annual renewal. The other 30% goes to Both websites provide free whois privacy, while other registrars charge another 10 bucks. They are also reliable and do not push to sell you add-ons.

[Credit: Featured image is proudly generated by Midjourney]

Leave a Reply

Your email address will not be published. Required fields are marked *