Custom DNS for EC2 instance

0

Hi there, I am looking to get some help on creating a custom public DNS unlike the DNS which is created by default *.amazonaws.com. I actually want to have a self signed wildcard certificate which would deal with all the subdomains(all ec2 instances created). I am not able to use wildcard for default *.amazonaws.com for obvious reasons.

Would appreciate any help! Thanks!

asked 8 months ago697 views
2 Answers
1

Here are the general steps to assign a custom domain name to your EC2 instance using Route 53:

First, register your domain name with a domain registrar such as Amazon Route 53, or transfer your existing domain to Route 53.

Next, create a hosted zone in Route 53 that corresponds to your domain name.

Create an "A" record in the hosted zone that maps your domain name to the Elastic IP address of your EC2 instance.

profile pictureAWS
answered 8 months ago
profile pictureAWS
EXPERT
reviewed 8 months ago
0

EC2 instances indeed come with Public DNS names that allow access to your instances via the internet. However, it's important to note that these Public DNS names are not designed to be stable over time. They can change when instances are stopped and started, or when there are changes to the underlying infrastructure. This can potentially lead to disruptions if you rely on the Public DNS names for your application's accessibility.

To achieve a more stable and reliable solution for handling traffic to your instances, we recommend utilising an Elastic Load Balancer (ELB). An ELB provides a single endpoint that distributes incoming traffic across multiple instances, increasing the availability and fault tolerance of your application.

You can also have a look on our post Why can't I configure ACM certificates for my website hosted on an EC2 instance. Should you need more specific guidance, please provide us with more details about your use case and/or compliance requirements.

AWS
Piotrek
answered 8 months ago
  • Thanks for the response @Piotrek and @Dave. I am looking to initiate my EC2 using the cloudformation template and basically all this custom domain logic would come into the template. So Will this work there as well?

    Also, the above one seems to be lenghty approach. If I could get the wildcard certificate dealing with all the subdomains/ec2 DNS ending with *amazonaws.com, that would also satisfy my use case.

  • You can read our blog on how to use AWS Certificate Manager with AWS CloudFormation to create and validate the certificate and another re:Post article about attaching ACM certificates to ALB. Generating certificates for Amazon-owned domains is not possible. You might be interested in using Amazon CloudFront. CloudFront comes with built-in, free TLS certificate for the .cloudfront.net domain, as well as TLS support for custom domain names. Using CloudFront can enhance the security and performance of your web application.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions