Quick answer: Point only YOUR computer at the new server by adding a line with the new IP and your domain to the local hosts file (or use curl --resolve). The public keeps seeing the old site while you browse the copy under its real domain name — the only honest way to test virtual hosts, SSL and redirects before cutover.

Overview

Testing on a bare IP or temporary URL misleads: WordPress and most apps generate links from their configured domain, SSL certificates are issued per hostname, and web servers route by Host header. A hosts-file override lets you use the production domain against the new server, so what you test is exactly what goes live.

Before you start

  • The new server's IP address (from your Cloud2Y Client Area service page).
  • The site fully deployed on the new server, including SSL certificate.
  • Administrator rights on your computer to edit the hosts file.

Step-by-step guide

  1. Edit the hosts file: on Linux/macOS /etc/hosts, on Windows C:\Windows\System32\drivers\etc\hosts. Add:
    203.0.113.10 example.com www.example.com
  2. Flush the DNS cache: macOS sudo dscacheutil -flushcache, Windows ipconfig /flushdns, most Linux resolvectl flush-caches.
  3. Browse the site: your browser now hits the new server under the real domain. Click through key pages, forms, login, checkout.
  4. Command-line spot checks without editing hosts:
    curl -I --resolve example.com:443:203.0.113.10 https://example.com/
  5. Remove the hosts entry after testing so your machine follows real DNS again.

Common issues

  • Browser cache confusion: use a private window; cached redirects and HSTS can mask what the new server actually serves.
  • Forgotten hosts entry: weeks later you debug "DNS issues" that are just your own override — always clean up.
  • Certificate warnings: if SSL is not yet issued on the new server, expect warnings during the test — issue it before cutover, not after.

When to contact support

If the site behaves differently between old and new servers and you cannot see why, send both URLs' behavior plus your hosts-file line in a ticket — this is a two-minute diagnosis with the right details.

Frequently asked questions

Why not just test the new server by its IP address?

Because virtual hosts, SSL certificates and app-generated URLs all depend on the domain name. A hosts-file override tests the real domain against the new IP — production conditions.

Does editing the hosts file affect my visitors?

No, it only changes name resolution on your own computer. Everyone else keeps resolving public DNS and seeing the old server until you actually switch the records.

What is the quickest hosts-free way to test one URL?

Use curl with --resolve, for example: curl -I --resolve example.com:443:NEW_IP https://example.com/ — it pins the domain to the new IP for that single request.

Related articles

Ready to move? Order a VPS at Cloud2Y →

Was this answer helpful? 0 Users Found This Useful (0 Votes)