
Editing your host file
Modifying your host file is essentially forcing your web browser to look in a particular place to see a web page. This is particularly useful if you already have a website running somewhere and want to look at it in a new or temporary location while it’s under development, after a host move or in any sort of test or staging environment.
Your developer or host may ask you to do this in order to conduct testing or simply preview something with you for approval or comments. It’s an incredibly useful trick to have access to and although it may sound, and perhaps look, like it’s a complicated procedure it’s incredibly quick and easy to do, entirely reversible and won’t cause any damage at all
When in the file it’ll look something like this:
192.168.1.30 acquirecommerce.com www.acquirecommerce.com
As you can see, there’s an IP address which will be the new/temporary location you want the browser to point, then the web address both with and without www. Simple eh? What you’re essentially saying is instead of looking for the website at it’s normal location, go to this IP address only for anything on this web address (with or without www) and show me what’s there.
In the below guide we show you how to modify your host file and revert any changes made once you’re finished. If you have any problems with this guide please get in touch and we’ll be glad to talk you through it.
FOR WINDOWS USERS
Locate Notepad on your PC
For Windows 7 and earlier: click Start then navigate to Accessories.
For Windows 8 or 10, type Notepad into the Start menu.
When you see Notepad icon right-click on it and select Run as administrator
You might get a pop-up message, prompting you to confirm allowing the Notepad program to make changes.
Depending on your version of Windows, click Yes or Continue, that should then open Notepad for you.
Now notepad is open click “File” fron the top menu bar and go to “Open” then browse to C:\Windows\System32\drivers\etc as per the image below. You’ll need to click where it says “Text Documents” in the dropdown in the bottom Right and change this to all files. You will then see a file called “hosts” in the window.
Select and open this file.
This is the Hosts file and where you need to copy the information given to you by your developer. As an example simply put:
192.168.1.30 acquirecommerce.com www.acquirecommerce.com
Then save the file and exit Notepad.
Now, to speed things up, you should flush the DNS (Domain Name Server) cache as this is likely going to hold a copy of the DNS for your site already and mean you wont see the new version.
By Flushing this we ensure we’re going to see the correct site.
To do this you must open the Windows command prompt:
Click Start, type command, and select Command Prompt in the search results listing.
Flush the DNS cache by typing the following command with a space between ipconfig and /flushdns:
ipconfig /flushdns
Hit ENTER
You should see a success message.
To test your website, open your browser and then enter the URL for your domain name.
To DISABLE the above you need to open the host file again as described and either put a # infront of the line (useful if you’re going to be switching between the development and live versions)
#192.168.1.30 acquirecommerce.com www.acquirecommerce.com
Or delete the line entirely then save. After that Flush your DNS once more to refresh everything then you can go back to seeing the live version of the site as normal.
For OS X
Open the Terminal application by either typing Terminal on the Spotlight, or selecting Applications > Utilities > Terminal.In the Terminal window, open the hosts file by typing the following command string:
sudo nano /private/etc/hosts
When prompted, type your user password. The hosts file contains some comments preceded with “#,” as well as some default hostname mappings.

