How to Test a Website Before DNS Propagation: 4 Methods Compared
You have migrated a website to a new server. Before updating DNS, you need to verify it works. There are several ways to do this, each with different trade-offs.
Test the new server before you change DNS. Open the free preview tool
Method 1: Edit the Hosts File
Every operating system has a hosts file that overrides DNS resolution locally (format: hosts(5)). By adding a line like 203.0.113.5 example.com, your browser will connect to the new server instead of the old one.
Pros:
- Free and built into every OS.
- Works with any application, not just browsers.
- No third-party service involved.
Cons:
- Requires admin/root access to edit the file.
- Only affects your own machine. Clients and team members must repeat the process.
- Easy to forget the change, causing confusion later.
- Does not work on phones or tablets without rooting.
- No shareable link for approval workflows.
Hosts file location:
- Windows:
C:\Windows\System32\drivers\etc\hosts(Microsoft notes that Notepad may need to be opened with Run as administrator to save changes: Microsoft guidance) - macOS / Linux:
/etc/hosts
If you prefer this method, use the hosts.click Hosts File Generator to generate the correct entry.
Method 2: Browser Extensions
Extensions like the hosts.click browser extension override DNS resolution inside the browser only, without editing system files.
Pros:
- No admin access required.
- Toggle on/off easily.
- Only affects the browser, not the whole system.
Cons:
- Still only works on your own device.
- Not shareable with clients.
- Requires installing an extension.
Method 3: Online Preview URL Tools
Services like hosts.click generate a unique subdomain (e.g., abc123.hosts.li) that proxies requests to the new server while sending the original domain in the Host header.
Pros:
- Works instantly, no software to install.
- Shareable link: clients, QA, and team members can all access it.
- Works on any device including phones and tablets.
- HTTPS included automatically.
- Additional tools: SEO crawler, diagnostics, analytics.
Cons:
- Traffic goes through a third-party proxy.
- Some CMS features that depend on the exact domain may behave differently.
This is the most practical method for professional workflows where multiple people need to review the site.
Method 4: VPN or SSH Tunnel
Route your traffic through the new server using an SSH tunnel or VPN, then use the hosts file or DNS override on the remote side.
Pros:
- Full control over the network path.
- Traffic stays private.
Cons:
- Complex setup.
- Not practical for non-technical clients.
- Overkill for simple preview tasks.
Comparison Table
The full comparison table, and the hosts-file steps for Windows, macOS and Linux, are in the preview-before-DNS guide.
Recommended Workflow
- Use a preview URL for team and client review.
- Use the browser extension for quick local testing during development.
- Use the hosts file generator when you need to test non-HTTP services.
- Run the Website Crawler on the preview link to catch SEO issues before cutover.
Try hosts.click for free and preview your next migration in seconds.
Improve Preview Workflows
Use these focused guides for DNS previews and control panel integrations.
Preview Website Before DNS Changes
Step-by-step workflow for testing on the new server before you switch DNS.
Preview website before DNS changescPanel Preview URL Plugin
Install script, usage steps, and troubleshooting for cPanel-based previews.
cPanel preview URL plugin guideDirectAdmin Preview URL Plugin
Integrate preview links directly in DirectAdmin with one install command.
DirectAdmin preview URL plugin guide