David Pennington

/ Blog

Building my website Pt. 1

In this 3 part series I'm going to show you how I built the first version of my website. We are going to cover a few topics here, mainly centered around 3 topics; Domain registration/DNS, Code, and Deployment.

Domain Registration / DNS

I use Namecheap for my domain registration, I find it to be the easiest site to deal with, they generally try to stay out of your way with their upsold products. My domain is pretty simple, but I do use Fastmail for my personal email server, so there is some extra setup that needed to be done to route SMTP and DKIM. The other setup is setting A records to point to my AWS intance that we will talk about in the Deployment section.

What is DNS?

DNS (or Domain Name Systems) is a network databases which store information for the internet in a specific format. DNS is what your browser uses to convert www.dpenning.com to my AWS Deployment. It can also be used to store specific types of key value pairs that allow other web services to validate data or transmit it securely. DNS Records are those key value pairs which are returned when a DNS Query is made. There's a whole list of different record types that you can store for your DNS configuration. but I am only using A records and CNAME records right now.

What is an "A" Record?

A Records are DNS records that returns an IP (IPV4) Address for a given hostname. In my case I want to point dpenning.com and www.dpenning.com to the same IP Address so In my console I have...

Type Host Value
A Record @ AWS IP ADDRESS
A Record www AWS IP ADDRESS
You will see there is special symbol @ which matches the "naked" hostname (dpenning.com). Another way to implement this functionality is to provide a "CNAME" record which points a hostname to another domain

Type Host Value
A Record @ AWS IP ADDRESS
CNAME Record www.dpenning.com dpenning.com

How do you get email to work?

I use fastmail to view the email thats routed to my domain. in order to set that up, I had to add a couple different records. First, i set up MX records that point to the fastmail SMTP servers

Type Host Value
MX Record @ FASTMAIL SMTP SERVER 1
MX Record @ FASTMAIL SMTP SERVER 2

Fastmail has 1 more step to get email to send correctly, you need to add DKIM information to your domain. DKIM is an encryption protocol which uses public key cryptography to ensure that message contents aren't altered. In order to add it to my domain I added a couple CNAME records that point to several of Fastmail's DKIM servers.

Type Host Value
CNAME Record fm1._domainkey FASTMAIL DKIM SERVER 1
CNAME Record fm2._domainkey FASTMAIL DKIM SERVER 2
CNAME Record fm3._domainkey FASTMAIL DKIM SERVER 3

This is what I had to do in order to set up my DNS, your results may vary depending on your Registar/DNS/Email provider.

Conclusion

Setting up your domain is pretty easy with some knowledge about how records work and how to set them up with your registar/DNS provider. In the next post in this series, Ill go over how my website is structured and why I made some of the decisions I did.

Corrections? Questions? Want to talk about anything in this post? send me an email at...

blog@dpenning.com