Test Your Website Before Changing DNS: The Hosts File

By Noiz / 11th November 2026 | 4 min

The hosts file lets your own computer see your website on its new Noiz server while everyone else still sees the old one. You add one line that maps your domain to the new server's IP address, browse the site, fix anything that is wrong, and only then change DNS. Visitors never see a half-finished site, and the move happens without downtime.

Last reviewed: 10 November 2026.

Before you start

  • Your site is on the Noiz server. The files and database are copied across. Moving your website to Noiz without downtime covers the copy, and moving your WordPress site to Noiz covers WordPress.
  • The server's IP address. It is in your Noiz welcome email and in Plesk. 203.0.113.10 below stands for it.
  • A Mac or a Linux computer for the hosts-file method, and a terminal. The curl method further down works on any system.

What is the hosts file?

The hosts file is a plain text file on your computer that lists names and the addresses they should go to. It is checked before DNS, so a line in it overrides what the rest of the internet sees, for you only. It does not change your domain, and nobody else is affected.

How do you add a hosts-file entry?

  1. Open the hosts file in a terminal. On macOS or Linux:
sudo nano /etc/hosts
  1. Add one line at the bottom, with your server's IP address and your domain. Include the www name if visitors use it:
203.0.113.10  yourdomain.com  www.yourdomain.com
  1. Save and close. In nano, press Ctrl+O, Enter, then Ctrl+X.
  2. Clear the cache. On macOS:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

On Linux with systemd, run resolvectl flush-caches. Then quit and reopen your browser.

  1. Open the site in a private window. You are now looking at the Noiz copy.

What should you test?

Walk through the site as a visitor would:

  • The home page and a few inner pages, with images and fonts loading.
  • Forms, such as contact and checkout, and the email they send.
  • Logins, for visitors and for your admin area.
  • Search, downloads and anything that talks to a database.

Expect a certificate warning on HTTPS at this stage. A free certificate can only be issued once the domain points at Noiz, so it arrives after the DNS change. Ask us to install one before the switch if you want a warning-free test; we can arrange it as part of a migration. SSL certificate errors and "Not secure" warnings explains the rest.

How do you test without editing the hosts file?

Use curl, which sends one request to the Noiz server and leaves your computer untouched:

curl -I --resolve yourdomain.com:443:203.0.113.10 https://yourdomain.com/

A 200 or 301 answer means the server responds for your domain. Add -k to ignore the certificate warning while you test. This works on macOS, Linux and any system that has curl.

What next?

  1. Remove the hosts-file line. Delete it, save, and clear the cache. If you forget, your computer keeps showing the Noiz copy after the switch, and you will not notice a problem on the live DNS.
  2. Lower the TTL on the records you will change, at least one old TTL ahead. DNS records explained shows how.
  3. Change the DNS, and keep the old hosting for a few days.
  4. Check email separately. The hosts file only affects websites. Create the mailboxes on Noiz, test them in your mail app, and move the mail records last.

Troubleshooting

Symptom Fix
You still see the old site The cache was not cleared or the browser was not restarted. Use a private window
"Permission denied" when saving Open the file with sudo, as above
The site is broken on the new server Good: that is what this test is for. Fix it, and test again before DNS changes
The new site looks right but visitors still see the old one DNS has not changed yet. That is the next step
The page loads but the images do not They are loading from the old address. Check the paths and the HTTPS addresses

Need a hand?

Open a ticket in the console and we will check the new site with you.

Official Documentation Reference

Read next