The overall goal is to shorten the amount of time required when re-pointing a domain name (URL) to a new server/hosting environment. The below example will walk you through a similar scenario and give you an idea of the process and the expectations or outcomes that you will hopefully achieve.
Brief synopsis of what TTL is: Time to live (TTL) is a mechanism that limits the lifespan or lifetime of data in a computer or network. Time to live may also be expressed as a date and time on which a record expires.
For example a shortened TTL (300 second) would help records expire in 5 minutes to ensure these records are flushed in a very short period of time rather than waiting for a 24 hour or 48 hour time period to pass. The TTL is changed at your Domain name (provider or registrar).
Please note: The following example is of a technical nature and would probably require someone from your IT department to translate.
We will utilize the following example as an explanation:
The Domain name (URL) is www.organizationurl.com and is hosted at the Internet Service Provider or ISP "hoster"
www.organizationurl.com has its ns1 record (ns = Nameservers) as ns1.myFirstNameServer.net and its ns2 record as ns2.myFirstNameServer.net
You setup a new name server with ns records as ns1.aNewNameServerIdecidedToBuy.net and ns2.aNewNameServerIdecidedToBuy.net -- its IP's point to the current server hosted by "hoster"
Both my name server domains (myFirstNameServer.net and aNewNameServerIdecidedToBuy.net) are setup and reside with my registrar in their DNS (Domain Name System) setup -- its IP's point to the new server at the new "hoster"
Once I am ready to make the switch, I will logon to my registrar and change the nameserver setting on www.organizationurl.com as follows:
By simply moving the web site to the new hoster, the registrar remains the same. NS1 and NS2 are set to current name servers (current hoster). I have a new ns1 and ns2 nameservers set and tested (at new hoster). So all I want to do is change the name server settings at my registrar when I am ready to switch. But I first want to make sure all the DNS servers "out there" will grab the new nameserver when I switch.
If you are simply moving the web site then you do not have to make any changes to the NS records, unless the current web hoster requires that you move your name servers when you move your web site (if the web hoster is also hosting the DNS zone). There's no requirement that the web hoster also host the DNS.
To keep things simple do one thing at a time, you should not change your domain's NS records during this migration. If you want to migrate the web site and also migrate the authoritative DNS server, do it in 2 separate steps. To migrate the web site, change only the A and AAAA records.
A conventional "low value" TTL to set on the A and AAAA records is 300 (5 minutes).
If you can operate both servers at the same time for a short period, then you can do even better than a DNS-based migration. You can set the old server to proxy requests to the new server, so that clients which still contact the old server get their requests forwarded to the new server. This is easy to achieve with Apache and
EDIT: Details about
This Apache config snippet, placed in the
<VirtualHost> section for your server, or directly in server config if there is no
<VirtualHost>, will allow the old server to forward all requests to the new server:
<Location /> ProxyPass http://www.example.org/ </Location>
You normally should have
ProxyPass but in this case it can be omitted since it would have no effect because the old site and new site have the identical
You probably want to remove any other
RewriteRule, or other URL-mapping directives from the old server config at the same time to be certain that the proxy rule and only the proxy rule gets processed. (Keep a backup around, of course, in case you need to back out of your migration!)
Make sure the old server knows the correct new IP address for the web site's domain, otherwise it will proxy the request back to itself!
When the migration of the site is complete don't forget to set the TTL for the A and AAAA records back to the original settings.