You have a domain that no longer hosts a site, but it still gets traffic: old links, users' bookmarks, or Google results pointing to old pages. You want all of these to go to the new domain or address, and at that very moment you realize there are two completely different paths before you: domain forwarding at the DNS level, or redirecting at the web server level. Choosing wrong between these two usually shows itself in the form of a 404 page or a gradual decline in Search Console.
What domain forwarding at DNS does and what you lose
In its simplest form, domain forwarding means registering an A record on the old domain that points to the IP of a forwarding service, along with a CNAME record for www. The forwarding service receives the HTTP request and sends it to the new destination with a 301 or 302 code. It's simple to set up and doesn't need your own web server.
The cost is this: forwarding at the DNS level usually does not preserve the path. That is, old.example.com/blog/post-12 goes to the destination's homepage, not to the equivalent of that same article. For a domain with several hundred indexed URLs, this means losing internal link signals and a bad experience for the user. If the path matters, simple forwarding is not your answer.
Second point: some forwarding services only work on the root record and don't cover subdomains. If shop.example.com also has traffic, you need to decide about it separately. For managing dynamic subdomains, wildcard records and managing dynamic subdomains in DNS explains what options you have.
Web server redirect: full control, at the cost of an active server
In this method, the old domain still resolves to a real web server, and that server enforces the redirect rule. In Nginx, a complete block is enough:
server {
listen 80;
server_name old.example.com;
return 301 https://new.example.com$request_uri;
}
The key to the whole thing is $request_uri. This variable is what makes the path and query string preserved. If you instead write return 301 https://new.example.com;, everything goes to the homepage and you create exactly the problem you wanted to avoid. In Apache, the equivalent inside .htaccess is this:
RewriteEngine On
RewriteRule ^(.*)$ https://new.example.com/$1 [R=301,L]
The cost of this method: you must keep a web server alive with a valid SSL certificate for the old domain. If the certificate expires, the browser shows a security warning before reaching the redirect and the user bounces. This isn't a small cost, but for a domain whose SEO matters, it's worth it. On a Linux host you can bring up this same block in a few minutes and renew the certificate automatically too.
Which one do I choose
If the old domain has fewer than roughly twenty indexed URLs and they all lead to one logical destination, DNS forwarding is enough. Fast, no maintenance, no certificate. If paths matter or the number of URLs is larger, I choose web server redirect with $request_uri. My practical boundary is where you want to write a one-to-one redirect map; at that point it's no longer about forwarding, it's about site migration.
This is where they go wrong: 302 instead of 301 and its caching
A common mistake I've seen many times: a temporary redirect (302) is set up for a permanent move, because "we want to test for now." Six months later, Google still recognizes the old domain as the canonical version and the new page doesn't move up in the results. Worse than that, browsers cache 301 aggressively; if you later change the destination, a user who has previously visited the site goes to the old destination for months and you see no error in the server logs. The symptom is this: "It opens fine for me, not for the customer." The first thing I do in this situation is test with a cleared cache and check the Location header with curl -I.
The correct order of setup and testing
- First bring the destination up completely, with a valid SSL. Redirecting to a site whose certificate is broken is the worst possible case.
- Record the current records of the old domain:
dig old.example.com A +short. After the change, run the same again to see what your resolver sees. - Change the
Arecord to the destination server or forwarding service and lower theTTLbeforehand. If the TTL is left at 86400, you wait a full day. The details are in DNS propagation and the role of TTL and caching. - With
curl -I https://old.example.com/some/path, look at the response header. It should be301and aLocationwith the same path. - In Search Console, register the address change and follow the indexing changes for a few weeks.
If the site doesn't come up at all after changing the records, probably a wrong record remains or the local DNS cache is stuck. The order for checking records is given step by step in the practical DNS troubleshooting guide and answers faster than guessing. To see what the records look like from the perspective of public servers, DNS record lookup is a good starting point.
Things you'll trip over in domain forwarding
- Email: web forwarding has nothing to do with email. If you don't touch the
MXrecords, email stays on the same previous service; if you fully move the domain and forget the MX, emails are silently lost. - HSTS: if the old domain has previously sent the
Strict-Transport-Securityheader, the browser will only try HTTPS until that period expires. An HTTP redirect on such a domain is useless. - .ir domains: changing DNS is free, but transferring ownership and changing the IRNIC identifier has its own rules. If your plan is a full domain move and not just forwarding, read the guide to registering and managing .ir domains with an IRNIC identifier before you start.
- POST and GET: a 301 redirect converts the method to GET. If you have a form or API on the old domain, the user faces a strange error that has nothing to do with DNS.
Frequently asked questions
Does domain forwarding harm SEO?
If done with a 301 code and with the path preserved, no; the signals are transferred to the destination. The harm comes when you use 302, discard the path, or build a chain of several redirects.
Why does the old site still open after setting up forwarding?
It's almost always DNS caching. Check the record's previous TTL and query a public resolver like 8.8.8.8 with dig. If the record is new there, the problem is on your browser's or system's cache side.
What's the difference between domain forwarding and domain parking?
In parking, the domain only points to a fixed page and there is no real destination. In forwarding, the user is moved to another address in the browser bar. If you intend to sell the domain, parking is more logical; if you have a new site, forwarding.
Can I forward only www and keep the root?
Yes. A CNAME record for www to the forwarding service and an A record for the root to the main server is enough. Just make sure the SSL certificate covers both names, otherwise the user sees a security warning on one of the two versions.
Before any change, save the current dig output and lower the TTL a day in advance. These two things alone reduce the most trouble.