This question already has an answer here:
- Redirect to www subdomain via DNS 5 answers
I would like to redirect domain1.com to domain2.com using DNS. I would further like to redirect www.domain1.com to www.domain2.com.
For domain1.com zone file, do I need to have an A record or are CNAME records sufficient, e.g.
* IN CNAME domain2.com. www.domain1.com IN CNAME www.domain2.com.
The goal is that when visitors visit domain1.com or www.domain1.com, they go to domain2