Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
1  
If you actually want to send a HTTP redirect, you can't do it inside DNS. If you don't care about the URL in the address bar changing, use a CNAME as pauska suggests. If you do care, you will need a web server of some sort to send the 301. Some DNS providers have this as a service, but I don't believe Route53 does this. –  cjc Dec 4 '12 at 16:33
    
@cjc I don't care about the URL in the address bar. –  fredley Dec 4 '12 at 16:35

1 Answer 1

up vote 7 down vote accepted

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
share|improve this answer
4  
This is not a redirect. In case, you have to define callback URL in some sort of third party service, above solution will not work. For example oAuth(Facebook, Twitter) Authentication. –  Ck- Mar 13 '13 at 9:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.