Launching a site or service usually involves updating DNS records such as A and/or CNAME Records. In these circumstances, you can't afford any mistakes. Depending on the TTL (Time-to-live) it can also take hours for the updates to propagate, meaning any required updates or rollbacks could leave your site with partial functionality or down entirely. Just like everything else, test before you go live.
The ideal way to test your live DNS updates is to override your local computer's DNS hosts file to mimic the DNS updates. This will allow your local computer to behave as if the DNS updates were already live. This is essential for testing hostnames, and especially SSL and their bindings.
It is assumed that all custom host headers/domains and SSL certificates have been installed on the production web server.
Local Hosts file
The local hosts file uses this format:
Where the first part is the IP address and the second part is the hostname. You would place the IP of the live server while the hostname would be the domain name of your live website.
Finding and Editing the Local Hosts file (PC)
- Press the Windows key.
- Type Notepad in the search field.
- In the search results, right-click Notepad and select Run as administrator.
- From Notepad, open the following file: c:\Windows\System32\Drivers\etc\hosts
- Add your hosts and the corresponding IP address you'd like to test
- Click File > Save to save your changes.
If you already have a browser session open, you will need to close it and re-open it or open a new incognito window to ensure the previous DNS settings aren't cached.
You should now be able to navigate directly to your domain names in the browser and have it resolve to your live server. Be sure to check all the domains and SSL bindings.