---
title: Preview your site before you change nameservers
description: Use a hosts file entry to load your new site from our server on your own computer, so you can test it before you point the domain over.
date: 2026-11-10
updated: 2026-12-05
tags: [dns, migration]
url: "https://drivenhost.com/kb/kb-preview-site-before-dns"
author: DrivenHost
---

When you move a site to us, you usually want to see it working here before the domain points this way. A hosts file entry does that. It tells your own computer, and nothing else, to load your domain from our server, while visitors and your email keep going to your previous host until you change the nameservers. Start by logging in to cPanel so you can copy the IP address your account uses.

## Find the IP address your account uses

1. Log in to cPanel.
2. Look at the General Information panel in the right sidebar.
3. Copy the value shown for Shared IP Address.

If your account has a dedicated IP, the address you need may be different from the shared one. If you are not sure which applies to you, ask us before you go further rather than guessing.

## Add the entry on your computer

You need administrator access on the computer you are testing from. Replace the example IP and domain below with your own, and put both the bare domain and the www version on the same line.

On Windows:

1. Right-click Notepad and choose Run as administrator.
2. Open `C:\Windows\System32\drivers\etc\hosts`, setting the file type dropdown to All Files so the file is visible.
3. Add this line at the bottom: `203.0.113.10 example.com www.example.com`
4. Save the file, then open Command Prompt and run `ipconfig /flushdns`.

On macOS or Linux:

1. Open Terminal.
2. Run `sudo nano /etc/hosts` and enter your password.
3. Add the same line at the bottom of the file.
4. Press Ctrl+O to save and Ctrl+X to exit.
5. On macOS, run `sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder`.

## Check the site, then remove the entry

1. Close your browser completely and reopen it, or use a private window, so it is not serving you a cached copy.
2. Visit your domain and click through the pages that matter: the home page, a few inner pages, any contact form, and the admin login.
3. Expect a certificate warning at this stage. A free certificate for the domain is usually issued after the domain actually points here, so the name on the certificate will not match yet.
4. When you are finished testing, delete the line you added, save the file, and flush the cache again.

Removing the line matters. If you leave it in place after the nameserver change, your computer keeps using the address you typed, and you will not notice if something is wrong with the live DNS.

## If it didn't work

- The hosts file was not saved. Windows will silently refuse the save if Notepad was not opened as administrator. Reopen the file and confirm your line is there.
- Your browser or operating system is still holding the old address. Flush the cache, quit the browser fully, and try again in a private window.
- The domain is served through a proxy or CDN service, or your browser is forcing HTTPS for it. In either case the hosts entry has no effect, and the practical option is to test after the nameservers change and the certificate is issued.

If the preview still will not load, send us the domain and the IP address you used through /support and we will check it from our side.
