How to edit your hosts file Print

  • 0

Your hosts file lets your computer use a specific IP address for a domain, ignoring public DNS. It's useful for testing a site on our server before changing your nameservers.

Add a line like this (using your server's IP, shown in cPanel's General Information panel):

185.12.34.56 yourdomain.co.uk www.yourdomain.co.uk

Windows

  1. Search for Notepad, right-click it and choose Run as administrator.
  2. Open C:\Windows\System32\drivers\etc\hosts (set the file type to All files).
  3. Add your line at the bottom and save.

macOS and Linux

sudo nano /etc/hosts

Add your line, press Ctrl+O to save and Ctrl+X to exit.

Flush your DNS cache afterwards. Remember to remove the line when you've finished testing, or you'll keep seeing the server you pointed to even after DNS changes.


Was this answer helpful?

« Back