DEV Community

Cover image for DNS Validation using AWS Certificate Manager (ACM) and Porkbun
Jerome S
Jerome S

Posted on

DNS Validation using AWS Certificate Manager (ACM) and Porkbun

tldr;

I found out I was adding the wrong details in Porkbun. The most crucial part was not including the trailing dot and using the correct host in the Porkbun CNAME record.

Adding A New Resume Website

I recently decided that I wanted to create a copy of my resume website on AWS just for practice.

I planned for the AWS website to be accessible via aws.jeromes.dev, and to make that happen I used:

  • AWS S3 to host the files
  • AWS CloudFront for the CDN
  • AWS Certificate Manager (ACM) to manage SSL certificates

I'm already using Porkbun as my DNS provider and domain registrar. Their UI is pretty straightforward, so I figured adding a subdomain would be too.

Steps To Add a Subdomain

I won’t dive too deep into each step, but here’s the high-level plan I went with:

  1. Upload the files to AWS S3
  2. Create a Distribution in AWS CloudFront for my desired subdomain
  3. Request a certificate for the new subdomain in ACM
  4. Add a new CNAME DNS record in Porkbun
  5. Wait for ACM to validate my certificate
  6. Finalize the CloudFront distribution setup using the issued cert
  7. Review everything and complete the setup

Since I’m using a custom DNS provider, I followed AWS’s guide for DNS validation.

Not too difficult, right? Everything seemed laid out clearly. But then I got stuck for an hour trying to get step 5 to work!

Where Did I Go Wrong?

After a few attempts, why wouldn’t ACM validate my certificate?!

Turns out, Porkbun does some things automatically behind the scenes.

Specifically, when adding the CNAME value, you’re not supposed to add the trailing dot (.) character!

Rookie mistake? Definitely. After all, all I ever did before was update nameservers or just create A Records. This was my first time creating a subdomain with a validation record.

Oh well, live and learn. At least I got it working—and you can now visit my new AWS-hosted resume site at aws.jeromes.dev.

Hopefully this helps someone else stuck in the same situation.

Top comments (0)