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
 
Subject: How to map domain name to AWS EC2 instance
Author: Linux
Posted on: 10/13/2011 02:19:39 AM

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.


    Replies:


    References:

  •  


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