How to edit your hosts file

How to edit your hosts file

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.

    • Related Articles

    • How to preview your website before changing DNS

      When moving a site to us, it's good to check it works before switching the domain over. There are two ways. Option 1: Edit your hosts file (most accurate) Point the domain at our server on your computer only. See How to edit your hosts file. This is ...
    • How to use the cPanel File Manager

      File Manager lets you manage your website files from your browser, with no FTP software needed. Log in to cPanel and click File Manager in the Files section. It opens in a new tab. The left-hand panel shows your folders; the right shows the contents ...
    • How to check PHP settings with phpinfo

      A phpinfo page shows the PHP version and settings your site is actually using. In cPanel File Manager, open public_html (or the folder for the domain you're checking). Click + File, name it something hard to guess such as info-82731.php, and create ...
    • How to manage billing and payment methods

      All billing for your Managed Web services is handled in the client portal. View and pay invoices Log in to the client portal. Go to Billing › My Invoices. Open an unpaid invoice and choose a payment method to pay it. Add or update a payment card Go ...
    • How to transfer emails using Outlook

      If you're moving email from another provider and the old mail isn't being migrated for you, Outlook can copy it across. Step 1: Add both accounts Add your old email account and your new Managed Web mailbox to Outlook, both using IMAP. Step 2: Copy ...