Assigning domain name to host on Route 53 in AWS - amazon-web-services

I'm deploying my first app on EC2. I have a domain name registered, lets call it example.com. My ec2 instance has a public ip, lets say, 100.100.100.100. When I got the EC2 instance, I already have a wordpress site installed on it (the blog for my app - blog.example.com). Hitting the public ip directly goes to the blog.
My app is running on the 4000 port of this EC2 instance. I want to assign the example.com domain to this.
I'm using AWS Route 53 for the DNS. I'm clicking on create a record set, where I give the name - www.example.com to the value 100.100.100.100:4000. The type is an IP-v4. However, when I try to assign this, I get the error below:
The record set could not be saved because:
- The Value field contains invalid characters or is in an invalid format.
It's because I've specified the port of the ip in the value. How do I get example.co to point to this app on 100.100.100.100:4000? Thank you for all the help in advance!

Amazon Route53 is a global Domain Name Service (DNS).
DNS services are used to resolve DNS names (eg example.com) to an IP address (eg 100.100.100.100). However, DNS servers do not point to ports on a machine (eg port 4000).
Therefore, to refer to 100.100.100.100:4000, you would use example.com:4000.

Related

Redirect a AWS static IP to domain

I have deployed a django based website on my AWS lightsail instance. the web address has a port 8000 (:8000). I own a domain on (host =fatcow.com). I have created a hosted zone on AWS and pasted the ns values to my provider(factor)'s Nameservers values. In the amazon route53, I have created a new record with a simple redirect A ipv4 and entered the resolver IP address value - my web address with port value. it doesn't work.
Also, I have read that the redirect will not work for its with port numbers. I have tried redirecting my domain to the static ip, then created another hosted zone record trying to redirect the static ip to the ip+port value - error pops up saying it is not a valid address.
I currently use the development server provided by django as it is a personal website and currently it will not have a lot of traffic - portfolio website.
Also, on my fatcow.com domain settings, the Nameservers are updated and in the whois values, new Nameservers are seen. I have only added the 4 NS values. AWS also created SOA ip values but I was not able to add them to the domain (Inputs were not taken by fatcow ).
In the NSLookup website, I can see NS values and SOA values which are on the AWS hosted zone but A records show none.
Edit: sorry for the confusion. my domain is www.chandradhar.com. I'm not a web dev but I'm trying to deploy a django based portfolio website. I have added Amazon Lightsail DNS nameservers to my domain (host=fatcow.com). the web address is :8000 port. Without the port number, the website isn't loading at all. Only with the port number along the static IP, the website loads. 'A' record isn't taking the port number. I did add a SRV record with the port number(in AWS route 53) but still doesn't work. when checked from the website nslookup.io, the nameservers are updated correctly
Not reproduceable.
> host fatcow.com
fatcow.com has address 65.254.254.33
fatcow.com mail is handled by 10 mail.fatcow.com.
Most probably your changes in DNS have already propagated.
Steps to successfully deploy one or more websites on lightsail AWS when the domain is on another website like godaddy/fatcow.
Create a dns zone in the networking section of the lightsail instance.
Copy the name servers from the dns zone and paste it in the name servers section of the domain provider (fatcow/godaddy) - it might take upto a day for the values to get updated - i used nslookup.io to see if my nameservers were updated.
Create 'A' records and SRV records pointing to the static ip of the lightsail instance.
Install Nginx
Create a simple script with the (name of the website).conf in the conf.d folder/available sites folder
Add the following script:
server
{
listen 80;
server_name domainname.com;
location / { proxy_pass http://ipAdd:PortNum;
}
}
Repeat the same code block with different domains and redirect ports. I guess we can also use 301 redirect to achieve the same.
This might or might not be the proper way of achieving what I required but it'll work.

AWS EC2 change public DNS hostname so that it works with Reverse DNS lookup

I've already gone through the following links but couldn't find anything useful:
https://forums.aws.amazon.com/thread.jspa?threadID=79119
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/set-hostname.html
How to change Public DNS in amazon ec2
EC2 t2.micro instance has no public DNS
I have a ec2 server running ubuntu. I've set up an elastic IP for the instance, and have configured my domain with that IP on Route 53. It's working fine.
Now I'm using the server to send a few (transactional) emails. I still haven't used TLS in the mails, so Gmail correctly shows that I havent encrypted this message in red. But instead of my domain name, it shows ec2---my-server-ip---my-server-location has not encrypted the message.
I ran reverse DNS lookup on https://www.whatismyip.com/reverse-dns-lookup/ and it showed the amazon server details.
How can I change this DNS hostname to my own domain name ?
https://forums.aws.amazon.com/thread.jspa?threadID=79119
Read that one again, because it contains your answer.
Create an A record matching the reverse entry you want, if you don't already have one, then send a request to AWS support to associate the hostname you want with the Elastic IP, using this form:
https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request
That's how you do it. It can only be done with an Elastic IP.
Reverse DNS look up is linked with the PTR record set by the owner of the IP address.
In case of AWS you need to get in touch with AWS support for setting up the PTR record for an Elastic IP address assigned to your account.
They will ask you to create a public zone file of reverse IP address followed by in-addr.arpa
eg. your ipv4 address is - 1.2.3.4
then zone file needs to be created with 4.3.2.1.in-addr.arpa with an PTR record pointing to your ipaddress.
You can refer this link for more information - https://aws.amazon.com/premiumsupport/knowledge-center/route-53-reverse-dns/

EC2 domain name ERR_CONNECTION_TIMED_OUT

I have bought a domain name from GoDaddy and would like to host it on an EC2 instance. I have created the instance and have installed apache. I have added an index.php with phpinfo(); and it is showing correctly when I access the public IP on browser. Now I would like to point my domain name to this instance. For this I have added an A RECORD at Godaddy DNS configuration. But when I access the doamin, it is showing
ERR_CONNECTION_TIMED_OUT
message in the broswer. Is there any additional settings I need to do ?
What you did is what it is needed. SO if it is not working then then you have to check everything again :
- check (for example with ping) if the domain is in fact resolving to correct IP address (from your computer and from instance for example to use different DNS servers). You can also use host command (for example host www.mydomain.com 8.8.8.8 - it will use google's dns (8.8.8.8) as the source of truth
- check if Security Group in aws allows inbound traffic (that's probably true as you can reach the instance directly)
- try to connect from different network (again this should not be problem as IP is reachable using IP).
you can also post the domain name and requested Ip so we can check this for you ;)

Amazon EC2 instance hosting

I have a application hosted in amazon EC2 instance. My application runs at http://ec2...compute-1.amazonaws.com/index.html. We also have a domain registered as sovan.test.com. WE want to use Route53 for redirect/open http://ec2...compute URL when user used the registered domain name. How can we do this?
We are getting an error that we can not host anything with index as back. and also it do not detect http:.
Please give some advice.
Thanks
Amazon Route53 is a Domain Name Service, which can resolve names into IP addresses. For example, if a user types www.foo.com, it can return the IP address of a web server of load balancer that will respond to a request.
Note that is only resolves the domain, which is the initial part of an address. It does not resolve the path portion of a URL. For example, going to www.foo.com/index.html will result in resolving www.foo.com to an IP address, then sending a request for the index.html page to that server. The index.html portion is not part of the DNS resolution.

domain won't resolve to aws ec2 - using route 53 and elastic ip

I struggle to connect my domain to my ec2 instance, although I have read every post on the internet i could find about the subject:
I am using Route 53 to route my domain to an Elastic IP, which is assigned to an EC2 Ubuntu 13.04 instance. nslookup for the domain from outside shows the Elastic IP address, but returns Server UnKnown.
My setup is as follows:
Domain All four Route 53 delegation set entries added as nameserver,
DNS lookup shows everything is distributed and fine
Route 53: A record sets for domain.com and *.domain.com, pointing to
the Elastic IP
Elastic IP: Assigned to the EC2 Instance
EC2 Instance: Ubuntu 13.04 with LAMP (MySQL disabled), vHost set for
*.domain.com and enabled, added 127.0.0.1 domain.com to etc/hosts file, everything restarted and set up
Entering the Elastic IP or the direct Instance IP works just fine, only use of domain returns "Cannot resolve hostname".
I would really appreciate any help on this.
The EC2 instance and Elastic IP are fine, or else you wouldn't be able to connect with the IP address. The problem is with DNS.
I don't understand how DNS lookup can show everything is fine, but you get "Cannot resolve hostname". That's saying that your local computer cannot convert the name you've assigned to an IP address. That means something is wrong with DNS.
Are you sure that you've registered your name servers with your registrar correctly? You said that DNS lookup says things are fine. If so, then the problem must be in Route 53.
Are you using * as a host name in Route 53? If so, replace it with a simple word (like www) and see if that works.