This site utilizes JavaScript to function correctly. Looks like it's disabled on your browser. Please enable it for your best experience.

For instructions on enabling JavaScript, click here

Skip to main content

Just Host Web Hosting Help

How to Change your Hosts File

What is a Hosts File?

The hosts file will allow you to set IP addresses for domains on your local machine. These files can override the authoritative DNS settings for your domain, so this can be useful for seeing what a domain will display if pointed to a different server. A typical hosts file will have one or more lines referencing your 'localhost'(your computer).

This is very beneficial for development purposes, as it allows you to make changes on a server other than the one loaded by your domain when visitors access your page.

Editing your Hosts File

To change the host your domain loads from, you will need to know the correct IP for your server. Just Host servers will require you to use the IP address displayed under Server Information in your cPanel.

Editing System Files

You can change the host your local computer loads your website from by directly editing your system's hosts file. This method will be easier if you are an experienced user of the operating system on your local PC.
All operating systems will have a hosts file like our example:

127.0.0.1 localhost
123.45.67.89 www.example.com
#98.76.54.32 www.another-example.com

Add the second line in this example to your hosts file, with the following edits:
  1. Replace "123.45.67.89" with the IP address from your cPanel.
  2. Replace "www.example.com" with your actual domain name.

To undo this change, deactivate the line by prefacing it with a "#" (as shown on the third line in the example above). This will cause the line to be ignored.

Remember to undo any changes you make after you're done previewing your site. Otherwise, any of these changes could prevent your domain from loading the correct DNS.

Flushing DNS

Once you have modified your hosts file, we recommend flushing your DNS cache to see the changes more quickly. For more information on flushing cache, please see DNS Cache Flush.

Knowledgebase Article 10,726 views bookmark tags: admin development dns file hosts ip test


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

How do I Change My DNS?
Knowledgebase Article 309,085 views tags: change delegate dns modify

How can I change the primary domain name on my account?
Knowledgebase Article 1,050,053 views tags: account change domain primary rename

Definition of an A Record
Knowledgebase Article 642,762 views tags: a dns file host ip record zone

Related Help Content

What are the commonly used DNS entries?
Knowledgebase Article 559,477 views tags: a aaaa cname dns record srv txt zone

Do you support wildcard subdomains or wildcard DNS entries?
Knowledgebase Article 151,708 views tags: dns domain subdomain wildcard zone

How to change the name of your WordPress site without WP Tools
Knowledgebase Article 40,044 views tags: change domain update wordpress

How do I Whitelist my IP Address? I can't log into MySQL from a remote computer using a MySQL admin tool (phpMyAdmin, Navicat, MySQLFront, MySQL-Admin, etc).
Knowledgebase Article 198,956 views tags: address ip list remote white whitelist

Once I Register a Domain, How Long Does it Take to Become Active?
Knowledgebase Article 269,599 views tags: dns domain register

This article will explain how to login to a website created with WordPress.
Knowledgebase Article 296,540 views tags: access admin change dashboard edit login site wordpress

You need two things to have a successful website and professional email: a domain registration and a hosting account.
Knowledgebase Article 100,706 views tags: dns domain domains nameservers servers

How to Modify Your DNS Records
Knowledgebase Article 1,015,248 views tags: dns

** Google ad credits are only available to customers in the United States, Canada, and the United Kingdom at this time.

¹ VAT (Value Added Tax) is not included in our advertised price and will be charged separately and itemized on invoices and billing information. Standard VAT rates based on EU Member State regulations may apply. Learn more.