To set up a permanent redirect from an old URL to a new one using DNS records, follow these steps:
-
Choose the Appropriate DNS Record: Use an ALIAS record if you're redirecting the root domain (e.g., example.com) because CNAME is not allowed for the root domain due to DNSSEC restrictions.
-
Create the ALIAS Record:
- Configure your DNS provider to create an ALIAS record pointing the old domain to the new domain. This directs users and search engines to the new URL without losing the old site's ranking.
-
Implement a 301 Redirect on Your Web Server: Set up a 301 status code on your server to inform clients and search engines that the resource has moved permanently to the new URL, ensuring proper redirection.