0

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

user788171
  • 279
  • 1
  • 5
  • 14

1 Answers1

3

Impossible.

You can redirect using your web server configuration, or with your preferred scripting language (such as PHP).

With DNS you can only point to the server, like you did in your example, but the domain name won't change from one to the other.

Daniel
  • 7,137