Pointing EC2 instance to a custom DNS - amazon-web-services

I have been trying to follow this tutorial but it is more complex than it needs to be I hope because I can assign tag names manually and I can do the route53 stuff manually.
https://www.esentri.com/auto-register-ec2-instance-in-aws-route-53/
What I have so far is I have created a PUBLIC hosted zone. "myzoneabc.com" This was created indirectly after I created my registered domain in Route53.
I then launched an EC2 instance and took its AWS assigned DNS name and created a CNAME record as follows
server.myzoneabc.com CNAME ec2-35-177-xxx-xxx.eu-west-2.compute.amazonaws.com
I can RDP onto server with DNS = server.myzoneabc.com with no problem.
Problem with this is when I restart my EC2 then the DNS which I entered in my route53 record above is no longer valid because it will have been modified after a stop/start of my EC2 instance.
My EC2 instance is only created once and either in a running or stopped state, it is never terminated.
So question is , is there any way to have route53 point a DNS recore like server.myzoneabc.com at my EC2 instance without using the DNS that Amazon assigns it which is always different. Thats what I think these EC2 instance tags are doing in the tutorial link posted above.

You probably need to update your DNS provider to use the NS records of your hosted zone. Only creating the Hosted Zone, will not tell anyone on the internet to use it.
Follow the Developer Guide: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingNewSubdomain.html

Related

AWS duplicating EC2 instances makes it point to the same domain

I have created an EC2 instance that host a wordpress site.
Then I have created AMI image with it and created exact copy of the instance.
The instance that I have copied from is linked to a domain through Route 53.
A bizarre experience that I have right now is that (twice now), when I copy EC2 instances in a way described above, using HTTP to access either of the EC2 instances lead to re-routing to the domain that was routed by Route 53 for the first instance.
Shouldn't only the first instance be linked to the domain because that is how I have set the record in Route 53? Is it normal for duplicated EC2 instance to point to same domain when I copy it using AMI image? How do I make it so that the second copied instance does not get re-routed to the same domain as the first instance?
This really is unrelated to AWS, EC2, Route53, etc. You simply have the "Site Address" setting in your Wordpress configuration set as that specific domain name. Wordpress automatically redirects any incoming requests to the configured Site Address.

Linking subdomain on bigrock to Amazon EC2 instance

I have a domain name hosted on bigrock.in pointed to an Amazon EC2 instance using Route 53. The four nameservers generated are placed in bigrock and it is working fine.
Now I have created a subdomain of the domain in bigrock and I want it to point to my application in another EC2 instance in another AWS account. Is this possible?
Yes. The AWS account that is currently controlling your domain name with Route 53 must be used, but it can be pointed to anything on the Internet.
Steps:
In the AWS account with the "other" EC2 instance, create an Elastic IP Address and assign it to the EC2 instance. This will ensure that its IP address does not change when the instance is stopped and started.
In your existing Route 53 configuration (in the original account), create a Record Set for the sub-domain (eg images.example.com) of type A and enter the Elastic IP Address as the value.
Once you have set the nameserver for your domain to point to Route53, you no longer need to control the subdomains from bigrock services. Just add them to your Route53 dashboard, and they'll be reflected live.

OpsWorks app domains not resolving after adding elastic ip

I have an issue that I have been trying to work out for a while now. I am experimenting with AWS and thinking of moving sites over, but I can't get DNS to work with OpsWorks apps. I have a PHP / RDS stack that I have a few apps in.
These were working great except for the issue of OpsWorks instances having a dynamic DNS that changes upon instance reboot. I don't want to have to change my DNS records in Route53 every time that happens, so I implementated an EIP, registered it with the instance, and registered it with OpsWorks. I added rules to the policy that the EC2 uses for default VPC to accept incoming HTTP requests as well.
Now, when I add an A record to my DNS zone that points to the EIP, and add my domain in the OpsWorks app settings, my domain does not resolve in the browser. What am I missing?
OpsWorks does very little to manage DNS externally. All DNS management should be done through Route53.
To start, make sure you have your nameserver (NS) record properly configured to reference your domain in your hosted zone, and also make sure that whatever DNS provider you're using (e.g. name.com, etc) is configured to point to those DNS servers.
Also, regarding this point:
I don't want to have to change my DNS records in Route53 every time
that happens, so I implementated an EIP, registered it with the
instance, and registered it with OpsWorks.
You should really be using an elastic load balancer for this, not an elastic IP. You can associate an elastic load balancer with your OpsWorks stack so that any instances launched within the OpsWorks stack will be associated with that elastic load balancer. The additional benefit is that you can have multiple servers hosting your application as you scale.

Domain + AWS EC2: How to make www.mydomain.com point to my EC2 server?

I'm trying to create a website and I just bought a domain at domain.com. I also launched an EC2 instance in AWS. Which one of the options would I choose below so that going to www.edmundscoolsite.com would point to my EC2 instance?
There are actually a couple of options here.
The best option is to associate an elastic IP address with your EC2 instance, then use an A record. The EIP is yours until you release it, even if you replace your instance.
An alternative option is to make www.edmundscoolsite.com a CNAME record whose value is the public DNS for your EC2 instance, something like ec2-1-2-3-4.us-west-2.compute.amazonaws.com. When you replace your EC2 instance the CNAME will no longer be valid, however, which is why the first option is better.
In order to point www.edmundscoolsite.com to your EC2 instance, you can add a CNAME or A record.
more here : https://forums.aws.amazon.com/thread.jspa?threadID=87279

Creating subdomain in amazon ec2 instance

I have the instance ec2-xx-xxx-xxx-xxx.ap-southeast-1.compute.amazonaws.com. It is running a bitnami lamp stack.
How do I create a subdomain for this like subDomain.ec2-xx-xxx-xxx-xxx.ap-southeast-1.compute.amazonaws.com?
Is it possible to do such this or should I purchase a domain first?
Thanks
You cannot manage AWS domains. You need to have your own domain first and use Route 53 or any other DNS provider to create an A record pointing to this specific EC2 instance.
Before creating the A record however you will need to provision an Elastic IP and assign it to your EC2. Please keep in mind that every account starts out with only 5 Elastic IPs and if you need more you will have to get in touch with Amazon for approval.