You need to migrate from one domain name to another because you're changing the name of your zone.
Once you've established the new zone, create aliases pointing from each domain name in the old zone to the corresponding domain name in the new zone. For example:
a.foo.example. IN CNAME a.bar.example. b.foo.example. IN CNAME b.bar.example. c.d.foo.example. IN CNAME c.d.bar.example.
Change the NS and MX records in the old zone, as necessary, so they don't point to aliases:
foo.example. IN NS ns1.bar.example. IN NS ns2.bar.example. IN MX 10 mail.bar.example.
Change the PTR records for these hosts to reverse-map to their new domain names, too:
188.8.131.52.in-addr.arpa. IN PTR a.bar.example. 184.108.40.206.in-addr.arpa. IN PTR b.bar.example. 220.127.116.11.in-addr.arpa. IN PTR c.d.bar.example.
Next, configure any resolvers that use the old domain name as their local domain name to use the new one; for example:
This may require additional changes to the configuration of the host. If the host runs a mailer or a web server, check the server's configuration files. You may need to change the domain name the mailer uses in return addresses or the domain name it sees as local. You may need to reconfigure the web server with its new domain name or install a new SSL server certificate. Also, check that any authorization files refer to the new domain names, since IP addresses will now reverse-map to them.
Wait for some grace period, and then remove the aliases and the old zone. If you're not sure how long to keep the old zone around, you can use the zone statistics described in Recipe Section 5.15 to determine whether the aliases are still being used.
If you run BIND 9 name servers for the zone, you may be able to use the new DNAME record to simplify the setup of the old zone. DNAME records work like substitution rules in sed or Perl. For example, this DNAME record will "synthesize" CNAME records aliasing each domain name in foo.example to the corresponding domain name in bar.example:
foo.example. IN DNAME bar.example.
A querier looking up a.foo.example will find this CNAME record, created on the fly from the DNAME record:
a.foo.example. IN CNAME a.bar.example.
While a querier looking up c.d.foo.example will have this CNAME record returned:
c.d.foo.example. IN CNAME c.d.bar.example.
5.28.4 See Also
Section 2.4 for creating individual aliases using CNAME records, Section 5.15 for measuring zone statistics, and Section 9.3 and Section 9.4 for configuration of a resolver's local domain name.
BIND Name Server Configuration
BIND Name Server Operations
Delegation and Registration
Interoperability and Upgrading
Resolvers and Programming
Logging and Troubleshooting