Implement a Content Delivery Network to protect and accelerate your website
To Access our web server using a Fully Qualified Domain Name (FQDN) we need to map it.
To map an FQDN to a Static IP Address we modified the DNS Records of our domain
To connect to your web server over the Internet, you have to assign a globally-unique public IPv4 address to your instance, or VM.
AWS provides elastic IP’s which are public, these are static IP addresses mapped directly to your EC2 web server instance, in case we need to redeploy our instance we won’t have to update DNS records every time
Next, we visit our registrar website and purchase a domain. In this example, I will use Godaddy because it’s very popular, but you can also buy a domain with AWS using the R53 Service.
Log into your account, select your domain and go to the DNS Zone configuration
example using the domain tuitix.com
Create two records that point to your Static IP address
1st Record TYPE A for the TDL
@ (YOUR PUBLIC IP)
2nd Add a record for www
www (YOUR PUBLIC IP)
Note that DNS may take some time to replicate the new records, so we’ll have to wait for a little, give it at least 15 min.
Now we test, and Voila! it works!
But, there’s a better way. I like to use Cloudflare service to manage my DNS records, by delegating our DNS to Cloudflare we provide Content Delivery Network and DDoS Protection to our Domain, Cloudflare also offers additional services such as Web Proxy, Web Application Firewall, SSL and most importantly, Cloudflare dramatically improves our website performance.
In order to route our web traffic through the Cloudflare network, we’ll need to change our original nameservers to the Cloudflare nameservers.
The steps required to update your nameservers are:
- Log in to Cloudflare and make note of your nameservers.
- Update your nameserver records to the Cloudflare nameservers. (Useful Links)
Each domain registrar is slightly different. I recommend that you contact your registrar’s support center for the most accurate information.
- Confirm changes through the Cloudflare dashboard.
Once you have updated the Name Servers, we manage our DNS records on the Cloudflare dashboard