How can I test a new web server before changing public DNS?
Use a per-command DNS override to send a request to the new server while keeping the real hostname in HTTPS. This tests the intended virtual host and certificate without changing public DNS. It does not reproduce every CDN, proxy or client behaviour.
Before you start
- Authorised access to the destination IP and a safe existing URL on the intended hostname.
- curl available; use curl.exe in Windows PowerShell.
Instructions
1. Prepare a non-destructive endpoint
Replace app.example.com, 203.0.113.10 and /health with the real authorised hostname, target and safe path. The new server must present a certificate valid for that hostname. If access is deliberately limited to a proxy, coordinate an approved test path rather than weakening the firewall.
2. Send a bounded HTTPS request
Use the command for your local environment. The override applies to this hostname and port only. Do not disable certificate verification to conceal a certificate or virtual-host problem.
curl --resolve app.example.com:443:203.0.113.10 --connect-timeout 10 --max-time 30 --silent --show-error --output /dev/null --write-out "HTTP %{http_code}\n" https://app.example.com/healthTests the selected server using the real HTTPS name, with connection and total-time limits.
curl.exe --resolve app.example.com:443:203.0.113.10 --connect-timeout 10 --max-time 30 --silent --show-error --output NUL --write-out "HTTP %{http_code}\n" https://app.example.com/healthWindows PowerShell equivalent; NUL discards the response body.
3. Check more than the status
Confirm an expected response and the destination’s request log, then test relevant application flows in the controlled environment. Inspect redirects separately: a different hostname can return to public DNS and reach the old system.
Check the result
- The new server receives the request, TLS validates and the endpoint returns the expected application response.
Troubleshooting
- The test returns a certificate-name error
- Check the certificate and SNI virtual host on the destination. Keep verification enabled and repair the mismatch before cutover.
Official references
Use the documentation for your installed version when a flag, service name or platform feature differs.
