I administered my domain e.g www.abcd.com in Amazon Route53. Everything works perfectly, except that when user type abcd.com without www, it won't get resolved. How can I make it get resolved?
-
were you able to solve it? am looking for a solution myself – Mo J. Mughrabi Mar 23 '12 at 13:21
8 Answers
I think this might work:
Select an IPv4address and select the "Alias" radio button.
Leave the name field blank to indicate domain.com
Then the target is www.domain.com
I'll give it a try and let you know.

- 316
- 2
- 3
-
2note that there are 2 resources in total, by the end. 1 is for www.domain.com and the other is for domain.com, thank you Max! – iwan Mar 07 '13 at 02:56
-
this works for example.com and www.example.com - but I dont get it to work for http:// example.com - the reason I need http: // example.com to work is so google can validate my url and setup email for me – user1709076 Jan 24 '15 at 04:24
-
This works fine in the first domain. Not working in second domain. Second domain `domain2.com` is working but `www.domain2.com` redirects to `www.example.com`.. Any idea? – Pranjal Choladhara Mar 29 '20 at 20:02
To have your domain.com (without www) on Amazon Route53 you need:
- Go to your record sets;
- Create a Record Set, type A - IPv4 Address;
- Put your domain.com or www.domain.com on value and save.
On my case I create a new record set for www.domain too, but with type CNAME and put my ec2 domain.
[edit] Print of my current configuration:
[update] If not work for you then you need to check your apache configuration. Check the ServerName and ServerAlias to allow *.yoursite.com or just www.yoursite.com. Don't forget restart your apache after changes.

- 3,702
- 6
- 30
- 36
-
hi Lucas, thank you for sharing, what shall i put as name ? www? does it take time to propagate, it does not seem to work (just changed 5 min ago)? may I confirm that elastic ip is attached to EC2 instance? – iwan Oct 28 '12 at 13:01
-
hi Lucas, i tried using type A- IPv4 Address, name = www, put Elastic IP associated to the EC2, and again it works for www.abcd.com, but NOT for abcd.com – iwan Oct 28 '12 at 13:13
-
1
-
Glad that help some of you guys. For who that has the same as @iwan. Yes in name is www, in alias target put your actual domain (the domain of your A record). If not work for you then you need to check your apache configuration. Check the `ServerName` and `ServerAlias` to support *.yoursite.com or just www.yoursite.com – Lucas Serafim Dec 09 '13 at 20:00
-
If you're using CloudFront, make sure that "www" is allowed as an Alternate Domain Name on the CloudFront instance. From [this page](http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-values-alias.html): "The distribution must include an alternate domain name that matches the domain name that you want to use for your URLs instead of the domain name that CloudFront assigned to your distribution." In the General tab on the CloudFront instance, select "Edit" and add www.yourdomain.com to the Alternate Domain Names box. – wonderlr Aug 24 '17 at 23:18
Here is the solution that worked for me.
- Name: www.domain.com
- Type: A - IPv4 Address
- Alias: Yes
- Alias Target: Select the value from the drop-down list that you have for domain.com
- Leave other settings and press
Save Record Set
By the way Amazon does not charge for Alias queries. More information here.
Amazon Route 53 doesn't charge for alias queries to CloudFront distributions, ELB load balancers, or Amazon S3 buckets.

- 1,047
- 1
- 11
- 27
The following works for me:
For www.XYZ.com
- Create Record Set
- Name: *.XYZ.com
- Set Type A Type
- Alias: No
- Value: 127.0.0.123 (you website IP)
For XZY.com
- Create Record Set
- Name: XYZ.com (nothing to write here - leave it blank)
- Set Type A Type
- Alias: Yes
- Value: (wait a second for the Drop Down menu) - choose \052.XYZ.com
You can test with https://dnschecker.org if it works or not

- 1,114
- 1
- 18
- 31
-
Actually, this is what I was looking for, it took me 2 days to find your answer, it should be more ranked, Thanks – Andres Felipe May 08 '20 at 19:31
-
maybe this works, but it seems a bit strange that you are creating 2 hosted zones (www.XYZ.com & XYZ.com) just to redirect to www. – kimbaudi Sep 26 '21 at 01:58
For Goddady domain migrated to AWS, I took the basic configuration for domain.com and modified it a bit.
Search for somethin like this in your record set:
Name: domain.com (or www.domain.com)
Type: A - IPv4 address
Alias: No
Value: a_random_ip_address
I just added a new record set with:
Name: www.domain.com (or domain.com)
Type: A - IPv4 address
Alias: No
Value: a_random_ip_address
Remember afterwards to add www to your server (nginx, apache, etc)

- 3,646
- 3
- 31
- 37
Yes, this record is called your "zone apex" -- the bigcompany.com address, not www.bigcompany.com. You can use an IP value there, or you can specify an "alias" and point it to an ELB.
(Note: Route53 does NOT like @ values for either the record name or value.)

- 1,642
- 18
- 28
Route 53 doesn't allow naked domain redirection. There are some tricky ways around it though.
More:

- 633
- 8
- 18
The name abcd.com
has to have its own resource records to be resolved other than those of www.abcd.com
.

- 1,117
- 1
- 15
- 32
-
Hi jj1bdx, sorry for long returning and thanks for your comment. Would you mind to tell me how to create resource for abcd.com in route53? – iwan Mar 11 '12 at 10:46
-
I don't use the Route53, but you can add something like "abcd.com IN A 10.1.2.3" as usual. – jj1bdx Mar 12 '12 at 13:00
-
thanks jj1bdx, however i am still seeking an answer for Route53, the Route53 console somehow is confusing for me – iwan Mar 21 '12 at 22:51