InMotion Hosting Support Center

While reviewing this article, if you are not sure exactly what you need to do, we recommend watching the video above.

The following information is for Windows users. If you are using a Mac, please see our article on How to edit your hosts file on a Mac

What is a hosts file modification?

A hosts file modification is a simple Windows tweak that is used to trick your computer into resolving to a specific IP. This is especially useful when developing your site on our server when your nameservers are not pointed to us yet, and you are working with domain-name-dependent software (like FrontPage or a php content management system such as Joomla or Wordpress).

Run Notepad as administrator

To perform a hosts file mod, you will need to first run Notepad as administrator. This is because the hosts file is a system file and cannot be modified otherwise. Note: If you ware running Windows XP or lower, you won't need to run it as administrator as this functionality only exists in Vista and above. Locate Notepad within your Start menu. If it is not already there, you can type "notepad" into the search box to show it. Then, right-click on it and click on "Run as administrator".

Opening your hosts file

After you have Notepad up and running as administrator, you can then locate your hosts files and open it. While not all Windows versions store it in the same place, it is typically located within c:\windows\system32\drivers\etc\hosts. If you don't see it there, other possibilities are as follows:

  • Windows 95/98/Me c:\windows\hosts
  • Windows NT/2000/XP Pro c:\winnt\system32\drivers\etc\hosts
  • Windows XP Home/Vista/Windows 7 c:\windows\system32\drivers\etc\hosts
  • Windows 8 c:\windows\system32\drivers\etc\hosts

Now, we need to open our hosts file. With Notepad already open, click on "File", then "Open...". As the hosts file is not a standard .txt file as Notepad will look for by default, you will change the dropdown in the bottom right that says "Text Documents" to instead display "All Files(*.*)" Navigate to the location of your hosts file and double-click on it to open the file in Notepad.

Windows 8: Note on Windows Defender

If you are using Windows 8, Windows Defender is running by default and it prevents the change of the HOSTS file. You will need to allow this file to be edited by going into Windows Defender and doing the following steps:

  1. Navigate to Windows Defender hover over the right corner to bring up the navigation bar. Click on the icon that appears to be a magnifying glass to start a search. Type in "Windows Defender", click on the icon that appears. It will be labelled "Windows Defender." Click on this icon and the application will launch.
  2. When Windows Defender opens, click on the tab labelled Settings.
  3. Next, type in the location of the hosts file based on location of the Windows installation. Here's the default path: c:\windows\system32\drivers\etc\hosts
  4. Click on the Add button and you'll see it added to the list beneath the file locations.
  5. Click on Save Changes in the bottom right and then close Windows Defender.
  6. The next step will be actually edit the file. As per the instructions above, you will need to edit the file as an Administrator. Hover over the right side again, and then search for "Notepad". Open it as an administrator.
  7. Open the file as per your HOSTS file path.
  8. Make your edits, and click on SAVE by clicking on "File" to bring up the menu. This completes the HOSTS file edit in Windows 8.

Modifying your hosts file

Now that you have your hosts file open, its time to edit it. Within your hosts file, you should see something like the following:

# Copyright (c) 1993-1999 Microsoft Corp.
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
# For example:
# # source server
# # x client host localhost

Be sure to make a backup of your hosts file first

Just like any other changes such as ones that you would make on your website, be sure to back everything up before you make any changes. The do so, you may follow these steps:

  1. In Notepad, click on "File" and select "Save As..."
  2. In the file name, enter something you will remember such as hosts_file_09.16.2013
  3. Click "Save"

Locate the IP address that is associated with your account

You may locate your IP easily from right within cPanel.

  1. Log into cPanel
  2. To the left, you will see an option that says "Expand Stats". Click it to open more information about your account
  3. Scroll down to where you see "Shared IP address". If you have a dedicated IP, it will say "Dedicated IP" instead. This is the information that you will need for your hosts file mod.

Making the change

Using the information you have just gathered from cPanel, you will add some lines to your host file. They will look something like this:

After making the change, click on "File", then "Save". You have now made your hosts file modification.

Flushing your DNS cache

If your computer has cached your DNS, you will need to clear it. Luckily, we have an article that can teach you how to do just that:

How do I clear my local DNS cache?

How do I know that it worked?

The easiest way to see that it worked is to just go to your domain. Does it show your new site as it should on our servers? If there were no changes to your site from when you moved it, you might need to run a ping test to ensure that it shows the correct IP.

Support Center Login

Social Media Login

Social Login Joomla

Related Questions

Here are a few questions related to this article that our customers have asked:
Sub Domain not working
404 Error on everything except main page | Xenforo
Root folder issue in html when using the VPS URL given to me
Testing and Production Blog Site Coordination
Configuring a site prior to domain transfer
I cannot log into WP admin zone
Would you like to ask a question about this page? If so, click the button below!
Ask a Question
2012-06-11 6:45 pm
Done as said above... this is result
Your IP is (removed by me for privacy reasons)
26,127 Points
2012-06-11 7:00 pm
Hello Robert,

Unfortunately, you have given very little information by which to go by. I pulled up your account, but I have no context as to your conversation or previous support question - I have no way of seeing your previous support session in chat. Can you please provide us some information? Explain what you're trying to do and the problem you're experiencing. Using a HOSTS file change is done for the purpose of "tricking" your computer into thinking it's looking at a website differently from what it would normally do (you're basically changing the IP address it would normally resolve the website to). It's a technique often used by programmers to look at a website that is still "live" at another location. This change is ONLY for the computer where the HOSTS file change has occurred. You could also modify multiple computers, but this is only supposed to be a temporary matter to let you work on a website while leaving the live one up and running.

If you want immediate help on the issue, you are also welcome to utilize technical support via phone or chat.

If you have any further comments or questions, please leave a comment at the bottom of the page.


Arnel C.
2013-12-05 12:48 am
I can't save the host file after editing, it showing an error message, "check if the file is opened in another program"
2013-12-05 1:20 am
Ops it's fine now, I found the reason for this error.

Those who are getting this error, click start > search for notepad > right click on it > run as administrator.
When the notepad opens > click file > open > then browse to c:\windows\system32\drivers\etc\ > now from notepad click the "Text document (*.txt) " button and change it to All files.

Now you will be able to see the host file, just select it and click open button. Edit it > save it (cntrl+s).
n/a Points
2014-07-10 12:48 pm
No changes needed. Explained exactly what I needed explaining. Thank you very much!
n/a Points
2014-09-06 11:55 am
I am a brand-new InMotion customer and my site has juts been migrated to the new servers. This article walked me through this process step by step, which is a very good thing because I have no idea what I was doing or why I needed to do it.
n/a Points
2015-01-19 11:58 am

If i am in office and i user standard user account my IT department has block all socail media site from host file than How i detail host file without adminsatration account. 

26,127 Points
2015-01-19 12:09 pm
Hello Dipanjan,

I think you're asking if it's possible to modify the HOSTS file without an administration account. Basically, you will not be able to make these changes without the proper access. You will need to speak with your IT department and get permission before making any HOSTS file changes.

Kindest regards,
Arnel C.
n/a Points
2015-01-19 2:53 pm

Thanks for enlightening us. I am working on a drupal site. To edit the host file, do I need to have a local server installed or not necessarily? Because I already edited the host file, but when i type the website address in the browser nothing loads.

Also where in the host file should the IP address be inserted?


Looking forward to your support

26,127 Points
2015-01-19 3:12 pm
Hello Mamie,

Thanks for the question. You don't need to have the local server installed to edit the HOSTS file. The IP address change should be done near the top with the other IP addresses. For example:

# For example:
# # source server
# # x client host localhost

You can insert the IP address and the corresponding URL right under the localhost entry. As per the example above. Remember that URL is very specific. So, if you put an entry of "123.234.456.789" and it corresponds with "", then ONLY when you type in "" will that IP address apply. Developers often use this change so that they can see a website with the original URL, even if the rest of the world is seeing a different website coming from another IP address.

I hope this helps to answer your question, please let us know if you require any further assistance.

Arnel C.
n/a Points
2015-01-20 9:04 am

Dear Ann,

Thanks for your wonderful and swift support! I was able to get through. Actually i realised that I correctly edited the Host file, but in my browser forgot to type "www."which was written in the host file.


Look forward to your future support.


Best regards,


n/a Points
2015-01-28 5:28 am

Hi to all

please tell me that how can i block all website and allow only one wesite please tell me i am wating for your answers

26,127 Points
2015-01-28 11:43 am
Hello Ali,

Thanks for the question. You can actually use the same rules as you would use in blocking country IPs, except you would deny all and allow only the one IP address.

order allow, deny
allow from 123.456.789
deny from all

I hope this helps to answer your question, please let us know if you require any further assistance.

Arnel C.
n/a Points
2015-03-15 7:34 pm

I have transferred all my files from Yahoo to InMotion and placed all of them in the public_html folder in the cpanel. When I click the temporary URL the website does not come up just information saying that that it is activated but not showing, blah blah. My site is Am I doing something wrong? This is getting very frustrating. Thanks for any help!

17,717 Points
2015-03-16 10:59 am
Hello Jeff,

Thank you for your question. I tested your site on your Temp URL, and it seemed to be working successfully.

Are you still having issues at this time?

Thank you,
n/a Points
2015-03-24 2:50 am

I setup a joomla website on my windows server 2008.. now i wanted to view that outside local area network.the problem:


I have this static ip address at home, whenever I input my home ip address at the office. It will forward me to my router which is dlink 600L.. which then asked my username & password.


What I wanted is that, whenever I typed my static IP address, It will forward to my Joomla Webpage. Thanks in advance for those who can help. I'm not good at this. Please Please help

4,991 Points
2015-03-24 3:35 pm
Hello Newbie,

You will have to forward port 80 to your server which would have to be on the same network.

Best Regards,
TJ Edens
n/a Points
2015-04-26 10:43 pm


I just got your email that the transfer of my website is complete, but I have no idea if it worked or what's the next step.

When I try the temp URL, I get a site that doesn't look like my site should (a version of a construction page that I did not use).

When I type in the site's URL I do see the construction page that I modified. 

However, I don't know what's the next step. I'd appreciate some help now please. Thanks.

28,948 Points
2015-04-27 4:47 pm
Hello Yuri,

Did you use a hosts file mod to view your site on our servers?

Kindest Regards,
Scott M
n/a Points
2015-04-28 8:25 am

I attempted to do that Scott. But I can't save the Host file after I've edited it.

What format should the edited file be? I only have the option of saving as .TXT even when I run it as Admin.

17,717 Points
2015-07-27 9:30 am
Hello Yuri,

Thank you for contacting us. Your "hosts" file typically does not have a file extension, and is just named "hosts".

Thank you,
n/a Points
2015-07-15 7:49 am
Website Migration Step 7 The icon for the Original hosts file is clear file type displays "File." Text file icon shows stripes and displays text document . Inmotion rep stated to save the new hosts file as txt, but all other file in Hosts folder display "file." When I save the changed hosts file do I save as .txt or file? Thank you Richard Aldrich
26,127 Points
2015-07-15 9:58 pm
Hello Richard,

Thanks for the question about the hosts file. Basically, the file is a text file, but should be saved as a file and NOT as a .txt file. It's a system file that is not recognized if saved with the extension of .txt.

I hope this helps to answer your question, please let us know if you require any further assistance.

Arnel C.
n/a Points
2015-07-20 10:56 pm

The host file needs format: ‘IPaddress domain’ not ‘IP/somefolder/  domain’.  I do not see how it is going to work for users when their hosting is at something like at IP/~cpanelusername/. All instructions above and video example IP without a folder only.

4,991 Points
2015-07-21 9:05 am
Hello Manly Electronics,

You do not need to add a folder to the host file. Lets say for example I had a development environment on I would put in the host file "". This would allow me to go to if I needed to. If you are using IP/~userna5 then you do not need to use a host file mod as it is only to trick your computer into thinking the domain has already resolved to another server.

Best Regards,
TJ Edens
n/a Points
2015-07-21 8:32 pm

Thanks for reply but let’s be specific, If to access site the URL is then what the line in ‘hosts’ file should be to access it via  locally from my PC only?

4,991 Points
2015-07-22 12:26 am
Hello Manly Electronics,

You would put the following info into your Host File:

Then you would visit and it will load automatically.

Best Regards,
TJ Edens
n/a Points
2015-07-25 11:56 am

if u are unable to edit ur host file, simply copy the text from the host file and open another note pad with administrative privillage, paste the text and other text when u want, save the file by replacing the previous host file in c:\windows\system32\drivers\etc\hosts and u are done. 

n/a Points
2015-08-26 2:27 am


i have update the hosts file but after soe time the hosts file is come on the deault condition. I am using Windows 10 Please tell me how can i update and save the hosts file.

26,127 Points
2015-08-26 11:27 am
Hello Sandeep,

Check out this link on modifying the Windows 10 hosts file. You would need to modify it with the appropriate admin access in Windows.

If you have any further questions or comments, please let us know.

Arnel C.

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

32 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!