Logo

dev-resources.site

for different kinds of informations.

How to Add DNS Records for Your Domain in Route53

Published at
11/30/2024
Categories
webdev
route53
beginners
dns
Author
ntombizakhona
Categories
4 categories in total
webdev
open
route53
open
beginners
open
dns
open
Author
13 person written this
ntombizakhona
open
How to Add DNS Records for Your Domain in Route53

After configuring your Public Hosted Zone and updating your Name Servers at your third-party registrar, you type your domain name into the browser:

DNS_PROBE_FINISHED_NXDOMAIN

Oh no! Your domain name isn't resolving because it doesn't have an IP address associated with it. Therefore, it's time to obtain an IP address via an EC2 instance and add the necessary DNS records.

Let's Build... In Public.

Launch An EC2 Instance

  1. Launch an EC2 Instance.
  2. Name your instance: MyDomainServer
  3. Quick Start: Amazon Linux
  4. Amazon Machine Image: Amazon Linux 2 AMI (HVM) (Free Tier eligible)
  5. Architecture: 64-bit (x86)
  6. Instance type: select t3.micro
  7. Under Key pair (login): Create new key pair. (If you don't have one)
  8. Create key pair pop up.
  9. Key pair name: MyKeyPair
  10. Key pair type: RSA
  11. Private key file format: .pem
  12. Create key pair.
  13. Save it on your local device.

Network Settings

  1. Edit.
  2. Firewall (security groups).
  3. Create security group.
  4. Security group name β€” required: MySecurityGroup.
  5. Description β€” required: type in Security Group for My Web Domain
  6. Inbound Security Group Rules.
  7. Add Security group rule.
  8. HTTP.
  9. Source Type: Anywhere.
  10. Configure storage: leave as default.
  11. Advanced details: leave as default.
  12. Scroll to the bottom.
  13. User data β€” optional.

Paste this:

#!/bin/bash

# Update and install dependencies
sudo yum update -y
sudo yum install -y python3
sudo pip3 install flask

# Create a directory for the app
mkdir /home/ec2-user/hello-world

# Create the Flask application
cat > /home/ec2-user/hello-world/app.py <<EOF
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello():
    return "Hello World"

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=80)
EOF

# Run the Flask app
nohup python3 /home/ec2-user/hello-world/app.py &
Enter fullscreen mode Exit fullscreen mode

Number of instances: 1.
Launch instance.

Add DNS Records in Route 53

Once Route 53 is managing your domain, you can set up DNS records to route traffic.

A Record (Address Record):
Maps your domain to an IP address.
studentanalyst.co.za β†’ 88.80.66.177 (IP of an EC2 instance).

CNAME Record (Canonical Name Record):
Maps a subdomain to another domain.
www.studentanalyst.co.za β†’ studentanalyst.co.za

MX Record (Mail Exchange):
Directs emails sent to your domain to your mail server.
example.com β†’ mail.example.com.

TXT Record:
Used for domain verification or to specify additional information, such as SPF or DKIM for email security.

Adding a Record

  1. Open Hosted Zone
  2. Create Record
  3. Record Type: A
  4. Record name: ec2
  5. Value: Paste IPv4 address of ec2 instance
  6. Create record
  7. Status Message: INSYNC
  8. Paste in Browser: ec2.studentanalyst.co.za (ec2.your-domain.com)
  9. Message: Hello World
  10. Congratulations.

Conclusion

Route 53 is your DNS manager, and with it, you can now do much more with your domain while taking full advantage of AWS services, and launch sites that map to your domain.

route53 Article's
30 articles in total
Favicon
Dominio personalizado en Amazon API Gateway. Dominio desde GoDaddy.
Favicon
How to Simplify DNS Management in a Multi-Account Environment with Route 53 Resolver
Favicon
How to Add an Elastic (Static) IP to Your EC2 Instance And Update Your DNS Records on Route53
Favicon
Amazon Route 53: AWS's Powerful DNS Service πŸŒπŸš€
Favicon
AWS Private Zones To The Max
Favicon
Migrate a hosted zone to a different AWS account in few seconds!!
Favicon
Before You Dive into Route 53: Learn These DNS Terms
Favicon
How to Add DNS Records for Your Domain in Route53
Favicon
How to Set Up a Public Hosted Zone on Amazon Route 53 When Your Domain Is Registered with Another Registrar
Favicon
Convert http to https in AWS
Favicon
Amazon Route 53 Resolver endpoints now support DNS-over-HTTPS (DoH) with Server Name Indication (SNI) validation
Favicon
Automated DNS Record Management for Kubernetes Resources using external-dns and AWS Route53
Favicon
Automating AWS DNS Firewall Domain List Updates Using S3, Lambda, and CLI
Favicon
Issue 65 of AWS Cloud Security Weekly
Favicon
Unlocking the Power of AWS Route 53: Your Complete Guide to DNS Management
Favicon
How to Use AWS Route 53 for Free
Favicon
Setup AWS EC2 and Configure Route 53: Domain Redirection Made Easy!
Favicon
Deploying Static Website to AWS: A Step-by-Step Guide with S3, Route 53, and CloudFront
Favicon
Cross-Account VPC Associations with Route53 Private Hosted Zone and Addressing Terraform State Update Issue
Favicon
AWS Route53: A Beginner’s Guide
Favicon
Configuring a Custom Domain for API Gateway with AWS Cloud Development Kit (CDK): SSL Certificate Use and Route 53 Integration
Favicon
How to Host a Static Website on AWS Using S3, Route 53, CloudFront, and Certificate Manager
Favicon
Managing your GoDaddy domain with Route53
Favicon
Using a custom domain name in a Private REST API Gateway
Favicon
How to migrate DNS records from CloudFlare to AWS Route53 with Terraform&Terragrunt
Favicon
Multi-Account/Environment DNS Zones
Favicon
Creating a custom domain name for AWS Elastic Beanstalk application
Favicon
Failover Mechanism in Amazon Route 53 Private Hosted Zones
Favicon
Free dynDNS for your NAS: auto-update DNS with your latest IP
Favicon
Advanced Techniques in AWS API Gateway and Route 53

Featured ones: