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
- Search for Notepad, right-click it and choose Run as administrator.
- Open
C:\Windows\System32\drivers\etc\hosts(set the file type to All files). - 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.