QNimate

  • CoursesVideos
  • WP PremiumPlugins
  • DemosLab
  • Bitcoin BankingBuy, Sell, Store and Earn Interest
  • Home
  • QIdea
  • QTrack
Home Carbon Ads Pointing Domain to AWS Elastic Load Balancing

Pointing Domain to AWS Elastic Load Balancing

aws-elb

Amazon ELB is an auto scalable load balancer that sits in front of EC2 instances and distributes traffic between them. Client communicates with ELB not with EC2 instances directly.

When you create a ELB you get a domain name provided by Amazon AWS to make requests to the ELB. This domain name resolves to different IP address over time. This is done so that Round Robin DNS can be implemented as traffic to the load balancer increases therefore auto scaling takes place.

Pointing Root Domain or Subdomain to ELB by changing A or AAAA Settings

Changing A or AAAA records means changing the IP address associated with the domain name. As ELB doesn’t have a static IP address therefore we cannot use A or AAAA records in our domain registrar’s control panel to point domain to the ELB.

Pointing Root Domain or Subdomain to ELB by changing Nameserver Settings

Changing nameserver gives AWS complete control over the domain. Nameserver is changed at root domain level.

You can change the nameservers of your domain at your domain registrar’s control panel. To get the nameserver values from AWS, create a Route 53 hosted zone with the root domain name and you will get the nameserver values under NS record type.

Now create a A record and point it to the ELB as alias not with direct IP address because IP address of the ELB is not static. Now Route 53 will keep updating the IP address of the A record to match the IP address of the ELB.

Here is an screenshot which shows an example of Route 53:

Screen_Shot_2016-02-10_at_11 (1)

Note: Changing nameserver redirects email traffic to AWS which is not what you may want if you are using an email address with the associated domain. You can create a MX record set to redirect email traffic to somewhere else.

Pointing Root Domain or Subdomain to ELB by changing CNAME Settings

A root domain cannot have a CNAME associated with it. Only subdomains can have CNAME associated with it. CNAME is used alternative to A or AAAA records. A CNAME is an another domain. When we set a CNAME for a subdomain then the IP address of the subdomain is made same as the IP address of the CNAME.

To point a subdomain to ELB you can simply use the domain of the ELB as CNAME.

Note: Changing CNAME doesn’t affect email traffic.

Pointing Root Domain to ELB without changing Nameserver settings

We saw that a root domain can be pointed to an ELB by changing nameserver settings only. But if you don’t want to change the nameserver settings and still want to point the root domain to ELB then there is a workaround.

For example: if you have a domain named example.com and if you want to point it to an ELB then you can create a subdomain called as www.example.com. As subdomain can point to ELB via CNAME so point the www.example.com to the ELB. Now using domain forwarding forward example.com tarffic to www.example.com. So now you have indirectly pointed the root domain to the ELB.

It is completely okay to use www subdomain as many major sites use www subdomain and redirect traffic for root domain to www subdomain.

This way you don’t have to worry about MX settings also as they are not affected.

Feb 10, 2016Narayan Prusty
Find Recorded Audio File Location in CordovaCalculating Nonce for Raw Transactions in Geth
Comments: 6
  1. www.bathrobes.Design
    3 years ago

    Paragraph writing is also a fun, if you know afterward you can write or else it is complex to write.

    ReplyCancel
  2. Yash
    3 years ago

    I want to confirm this part:
    Pointing Root Domain or Subdomain to ELB by changing Nameserver Settings

    Lets say I have google business email and they provide their MX records.
    I create new NS records in AWS route 53.
    I update these new NS records to the domain registrar dns management console, say godaddy.

    I update the MX records from google business email in my amazon route 53 to get the incoming email.

    Then create an A record and mark it as alias and give alias target as ELB A name as provided in the ELB section of AWS.

    I dont need to map this A name to my Domain registrar right? or do i need to map this A name to domain registrar.

    Also do i need to map this A name to the email client? No right?

    Plz let me know asap. This article is very useful. Just want to clarify few things. Thank you,

    ReplyCancel
  3. kredit tanpa agunan
    3 years ago

    whether it is also working on a subdomain?

    ReplyCancel
  4. Logo
    4 years ago

    Awesome tutorial. Thank you, NARAYAN !

    ReplyCancel
  5. ArunJaganathan
    4 years ago

    Awesome tutorial.Thankx a ton ! :)

    ReplyCancel
  6. arjun
    4 years ago

    awesome post! thank you

    ReplyCancel

Leave a Reply to ArunJaganathan Cancel reply

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

Narayan Prusty

I am a full-stack web developer. I specialize in Blockchain and JavaScript. This is my personal blog where I write about programming and technologies that I learn and feel interesting to share.

Image5 years ago 7 Comments Cloud
Share this
0
GooglePlus
0
Facebook
0
Twitter
0
Linkedin
  • Pointing Root Domain or Subdomain to ELB by changing A or AAAA Settings
  • Pointing Root Domain or Subdomain to ELB by changing Nameserver Settings
  • Pointing Root Domain or Subdomain to ELB by changing CNAME Settings
  • Pointing Root Domain to ELB without changing Nameserver settings
Related Articles
  • Prefetching DNS using rel=”dns-prefetch”
  • Some Websites Not Opening In BSNL Broadband Solution
  • Bypass Same Origin Policy
  • Secret Blogging Tools And Methods That Will Help You To Succeed
  • HTTP/2 Compatibility with old Browsers and Servers
Our Sponsor
Freelance: I am available
@narayanprusty
Hi, I am a full-stack developer - focusing on JavaScript, WordPress, Blockchain, DevOps, Serverless and Cordova. You can outsource your app development to me.





Will get back to you soon!!!
WordPress
ReactJS
Meteor
Blockchain
Serverless
Kubernetes
DevOps
DB & Storage
Ejabberd
Let's get started
My Books

2014 - 2015 © QNimate
All tutorials MIT license