go to  ForumEasy.com   
JavaPro  
 
 
   Home  |  MyForum  |  FAQ  |  Archive    You are not logged in. [Login] or [Register]  
Forum Home » Amazon AWS » How to map domain name to AWS EC2 instance
Email To Friend  |   Set Alert To This Topic Rewarding Points Availabe: 0 (What's this) New Topic  |   Post Reply
Author Topic: How to map domain name to AWS EC2 instance
Linux
member
offline   
 
posts: 120
joined: 01/24/2011
from: San Jose, CA
  posted on: 10/13/2011 02:19:39 AM    Edit  |   Quote  |   Report 
How to map domain name to AWS EC2 instance
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.

  •  Profile | Reply Points Earned: 0
    Linux
    member
    offline   
     
    posts: 120
    joined: 01/24/2011
    from: San Jose, CA
      posted on: 10/13/2011 06:08:19 PM    Edit  |   Quote  |   Report 
    How to map domain name to AWS EC2 instance: Godday example
    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.

     Profile | Reply Points Earned: 0
    Linux
    member
    offline   
     
    posts: 120
    joined: 01/24/2011
    from: San Jose, CA
      posted on: 10/13/2011 06:20:01 PM    Edit  |   Quote  |   Report 
    How to map domain name to AWS EC2 instance: Amazon Route 53 example
    Another way is to use DNS hosting service, for example, Amazon Route 53.

    Details can be found here: http://support.rightscale.com/03-Tutorials/02-AWS/02-Website_Edition/2._Deployment_Setup/4._Domain_Setup/Domain_Setup_with_Amazon's_Route_53

    The whole point is:
                                    
      YourDomainRegistrar =====> DnsHostingService ======> ElasticIpOfYourEC2
                            ^                         ^
                            |                         |
                            |                         |
                      ns1.dnsservice.com           A Records  
                      ns2.dnsservice.com
    

     Profile | Reply Points Earned: 0

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