Free migrationUK web hosting from £2.99 a month, with backups every six hours and a 60-day money-back guarantee.UK web hosting from £2.99 a month.See hosting plans

How to preview your website before changing DNS

On this page

This guide shows how to view a site on our servers before your domain points here. You tell your own computer where to find the domain by editing its hosts file, check everything works, and then change DNS for real.

How it works

Normally your computer asks DNS where yourdomain.co.uk lives. The hosts file is a small text file on your computer that gets checked first. Add one line to it and only your computer will go to our server for that domain. Everyone else still sees the old site, so it’s a safe way to test a move.

Find your server’s IP address

  1. Log in to cPanel.
  2. On the cPanel home page, find the General Information box in the right column.
  3. Note the number shown as Shared IP Address. It looks like 203.0.113.25.

If you can’t see the panel, it may be collapsed or further down on a small screen.

Edit the hosts file on Windows

  1. Click Start, type Notepad, right click it and choose Run as administrator. Click Yes when asked.
  2. Choose File and Open from Notepad’s menu.
  3. Go to C:\Windows\System32\drivers\etc.
  4. Set the dropdown beside the file name box to All Files so hosts appears, then open it.
  5. Add these lines at the bottom, using your IP and domain:
203.0.113.25 yourdomain.co.uk
203.0.113.25 www.yourdomain.co.uk
  1. Click File, then Save.

If Windows says you don’t have permission, Notepad wasn’t opened as administrator. Close it and start again from step 1.

Edit the hosts file on a Mac

  1. Open Terminal from Applications, then Utilities.
  2. Type the command below and press Return. Enter your Mac login password when asked; nothing shows as you type.
sudo nano /etc/hosts
  1. Move the cursor down past the last line with the arrow keys, then type the same two lines as above.
  2. Press Control+O, then Return to save.
  3. Press Control+X to leave the editor.

Flush the DNS cache

Your computer may still remember the old address. Clear it so the new line takes effect.

Windows: open Command Prompt and run:

ipconfig /flushdns

Mac: in Terminal, run:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Then close your browser completely and open it again. Chrome and Edge keep their own cache, so a private window is a good way to make sure.

Check you’re seeing the new server

Go through the site and test the things that matter: the home page, a few inner pages, forms, logins and checkout. To be sure you’re on our server, add a temporary file such as test.txt in public_html and load it in the browser. If it shows, you’re looking at the new copy.

Expect a browser warning about the security certificate. Free SSL certificates are issued once DNS points to us, so before then the site may only load over http://, or you can click past the warning for testing. See how to install a free SSL certificate.

Undo it afterwards

This step matters. If you forget, your computer will keep using the line in the hosts file, which can confuse you later if anything changes.

  1. Open the hosts file again the same way.
  2. Delete the two lines you added, or put a # at the start of each to switch them off.
  3. Save the file and flush the DNS cache again.

Once you’re happy, update your nameservers or DNS records. See how to point your domain at our hosting and how to check DNS propagation.

If it doesn’t work

  • You still see the old site. Flush the DNS cache again, restart the browser, and check the IP has no typos. Some browsers use secure DNS that skips the hosts file; turn off Use secure DNS in the browser’s privacy settings while testing.
  • You see a cPanel default page. The domain isn’t added to your hosting yet, or files aren’t in its document root.
  • WordPress jumps back to the old site. Its saved site address differs from the domain you’re testing. See how to change your WordPress site address.
  • Your phone shows the old site. The hosts file only affects the computer you edited.

Still stuck? Open a support ticket and we’ll help.

Still stuck? Open a support ticket from your client area. Tell us your domain and which step went wrong, and we'll take it from there.
UK cPanel hosting from £2.99 a month

Every plan has cPanel, free SSL, backups every six hours and free migration.

See web hosting
Open in new tab