go to  ForumEasy.com   
JavaPro
Home » Archive » Message


[Email To Friend][View in Live Context][prev topic « prev post | next post » next topic]
  How to map domain name to AWS EC2 instance: Godday example
 
Subject: How to map domain name to AWS EC2 instance: Godday example
Author: Linux
In response to: How to map domain name to AWS EC2 instance
Posted on: 10/13/2011 06:08:19 PM

If you have your domain "mydomain.com" registered with GoDaddy.com, you can go to the GoDaddy DNS Manager, select Edit Zone for your domain, and put the your AWS EC2 instance's Elastic IP, for example, 123.123.123.123, in the box provided for the A record.

  A(Host) | Points to
----------+------------------
     @    | 123.123.123.123   


Here, @ stands for 'this', i.e. mydomain.com. This A record will resolve the following:
mydomain.com --> 123.123.123.123


Obviously, it does not resolve the subdomain www.mydomain.com. You have to add CNAME record:

  CNAME(Alias) | Points to
---------------+------------------
     www       | @   


This CNAME record will resolve the following
www.mydomain.com --> @ (mydomain.com) --> 123.123.123.123



As with most DNS changes, you may need to wait up until 24 hours for your change being propagated. GoDaddy takes less than 2 hours to push the change.


 

> On 10/13/2011 02:19:39 AM Linux wrote:

Prerequisites:
  • A running AWS EC2 instance -- now your instance can be accessed by [INSTANCE_PUBLIC_DNS_NAME] assigned dynamically by AWS
  • ElasticIP binding to your instance -- now your instance can be accessed by IpAddress ddd.ddd.ddd.ddd, for example, 123.123.123.123

    Goal: To make your instance publically accessed by your domain name, for example, mydomain.com

    1) You first need to register a domain, for example, mydomain.com through registrar.

    2) Most likely, your registrar provides you with a DNS hosting service, which allow you to set A records and/or CNAME records for the domain mydomain.com.

    3) If your domain name registrar does not allow you to do this, you need third-party DNS hosting provider. Your DNS hosting provider will give you the names of their DNS servers. You will get from two to five DNS servers, for example, ns1.dnsservice.com, ns2.dnsservice.com, etc. You then go to your domain name registrar (in this case, yahoo), and set the name servers for mydomain.com to ns1.dnsservice.com, ns2.dnsservice.com, etc.

    4) Finally, you go to your DNS hosting service, and set CNAME records or A records to point one or more hostnames at your instance. For example, you could set:

    mydomain.com A xx.xx.xx.xx
    *.mydomain.com A xx.xx.xx.xx

    Or you could set:

    *.mydomain.com CNAME ec2-xx-xx-xx-xx.compute-1.amazonaws.com

    A records is recommended. This reduces the number of DNS lookup's required to resolve your domain, and it allows you to set a record for mydomain.com, which you cannot do using a CNAME. If you have assigned the instance an ElasticIP, set the A record to the ElasticIP; otherwise, use the instance's public IP address.

    The *.mydomain.com record is called a wildcard. Not all DNS services will allow you to set a wildcard record. The wildcard matches all hostnames that are not set, such as www.mydomain.com, subdomain.mydomain.com, etc. xxx.mydomain.com. It does not match mydomain.com, and that is why you will usually want a record for mydomain.com, as well as a wildcard record. You can also set records for specific hostnames, such as www.mydomain.com, but this is not needed if you have a wildcard record.





    References:

  •  


     
    Powered by ForumEasy © 2002-2022, All Rights Reserved. | Privacy Policy | Terms of Use
     
    Get your own forum today. It's easy and free.