AWS Route 53 (DNS): Create Equivalent of URL Forwarding Record

Categories: Cloud Computing, Networking, Tips

Several advanced DNS providers (EasyDNS, DNS Made Easy, etc) provide URL forwarding functionality through the use of a “DNS” record.  It’s not really an official DNS record, but rather provides a “301 Server Redirect” (URL redirect) and abstracts the complexity from end users that are managing this functionality.

In order to accomplish the same desired effect without this advanced feature set, traffic for url.domainA.com would need to route to a web server that is configured to provide a (301) URL redirect to url.domainB.com.

route53

Amazon Route 53 does not directly provide this feature, however we can provide the same functionality by creating an Amazon S3 bucket configured for static website hosting to facilitate the URL redirect.

Instructions

  1. Create and configure Amazon S3 Bucket
  2. Create corresponding DNS record in Amazon Route 53

Amazon S3 Bucket

A S3 bucket must be created for each subdomain to be redirected, using similar settings (below).

Bucket Name:          url.domainA.com (DNS name of URL to be redirected)

Endpoint:                url.domainA.com.s3-website-us-east-1.amazonaws.com (auto generated FQDN for S3 bucket endpoint)

Redirect all requests to another host name:  url.domainB.com

NoteBucket Name must match the DNS record to be redirected exactly.

Amazon Route 53 (DNS)

Create an ‘A’ record and designate it as an ‘alias’ record.  This is an AWS Route 53 special record that allows the linking of a DNS record to an AWS object.  If the S3 Bucket was created correctly, it should be available for selection as an alias.

When a DNS lookup is performed on the newly created ‘A’ record, it will appear as a simple ‘A’ record and return the current IP address of the S3 Bucket.

For more details on the steps required to configure this functionality, refer to the following site:

Set up DNS based URL forwarding in Amazon Route53

«
»