Eliminate DNS Propagation Lag with a Reverse Proxy – A Case Study

The website migration described in this post provides a real-world example of how a reverse proxy server can facilitate a website migration and eliminate the lag caused by DNS propagation.

Summary

The client's situation is summarized below:

  • Client has a WordPress site that continuously receives user-generated content in the form of comments
  • Client is switching marketing agencies
  • Client's old marketing agency is also his current webhost
  • Client's DNS is hosted by his internet service provider (ISP)
    • To update DNS records, the client must submit a ticket to the ISP
    • It can take up to 24 hours for the ticket to be processed and completed.

Due to user-generated content, the client can't keep the website live on both the old web server and the new web server during propagation. A user post to the old web server would be lost.

Migration Steps

  1. Set up Reverse Proxy Server

The first step is to set up a reverse proxy server. The reverse proxy server should route incoming traffic to the existing web server.

The specifics of reverse proxy configuration are out of scope for this post, but there is excellent documentation out there.

Test the reverse proxy server by adding an entry to your local machine's hosts file to override the DNS records for the website. The entry should direct traffic to the reverse proxy.

  1. Update DNS Record

Next, update the DNS record for the website to the IP address of the reverse proxy server. During DNS propagation, visitors will be taken to either the web server or the reverse proxy server. In either case, they get to the same website on the same web server.

  1. Take Website Offline

Once DNS propagation is complete, we're ready to migrate the website. Take the website offline.

  1. Migrate Website to New Webhost

Once the website is offline, migrate its codebase, database, and user files to the new webhost.

Note: ALWAYS test a migration to a new webhost first! By the time you update DNS and take the website offline, you should have completed a successful test migration.

  1. Update Reverse Proxy Configuration

After the website has been migrated to the new webhost, update the reverse proxy configuration to route traffic to the new webhost.

  1. Take Website Online

Finally, take the website back online.

  1. Remove Reverse Proxy (optional)

If the reverse proxy server is no longer necessary, it can be removed by updating the website's DNS record to point to the new web server. Once propagation is complete, the reverse proxy server can be decommissioned.

Add new comment