Saturday, December 26, 2015

domain name system - How do I redirect www to non-www in Route53?



I host my site at domain.com.




My DNS entries in Route53 are as follows:



domain.com      A       xxx.xxx.xxx.xxx      300
domain.com NS stuff.awsdns-47.org 172800
domain.com SOA stuff.awsdns-47.org 900


I would like to redirect traffic from www.domain.com to domain.com, as currently this just returns a 404. This question on SO suggested a PTR record, and I added that:



www.domain.com  PTR     domain.com           300



but it didn't work. What should I be doing?


Answer



PTR is for setting up reverse IP lookups, and it's not something you should care about. Remove it.



What you need is a CNAME for www:



www.domain.com  CNAME  domain.com 300


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...