Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

What Is a Computer Host File and How to Edit a Host File?

Learn what a Computer Host File and How to Edit a Host File means, why it matters, how it works, and how to evaluate or use it effectively.

Table of Contents

This guide explains a Computer Host File and How to Edit a Host File, why it matters, how it works, and how to evaluate or use it in practical situations.

The host file has been in use since ARPANET. They are used to resolve host names before DNS.

Microsoft keeps the hosts file in the Windows network, which is why it changes so little even if it is used in Windows, macOS or Linux.

The first part will be the location to redirect the address, the second part will be the address you want to redirect and the third part will be the comment. They can be separated by a space, but for readability are usually separated by one or two tabs.

Windows 8 or 8.1 and 10

Windows 8 or 8.1 and 10 screenshot

If you use Windows 10, the way to edit the host file will look like this:

Windows 8 or 8.1 and 10 screenshot 2

When you're done, open the following file using the File -> Open feature: c: windowssystem32driversetchosts

Windows 8 or 8.1 and 10 screenshot 3

You can then edit as usual.

Windows 7

To access the hosts file in Windows 7, you can use the following command in Run to open notepad and file.

Windows 7 screenshot 4

When notepad is open, you can edit the file. In this example, we will block Facebook. To do this, simply enter the following after the www. facebook # com

Windows 7 screenshot 5

After editing the host file, save it.

Windows 7 screenshot 6

Now if you try to access Facebook in IE it won't work. We also cannot access Facebook through Google Chrome.

Windows 7 screenshot 7

macOS (Any Version)

In macOS, accessing the host file is also quite easy. Start in the terminal and use the editor.

macOS (Any Version) screenshot 8

The files will look a bit like Windows, though not as intuitive. Again we will block Facebook.

macOS (Any Version) screenshot 9

This time use 0.0.0.0 as a loopback and will direct you to the computer's Apache test page.

FAQ

What should I know about a Computer Host File and How to Edit a Host File?

Focus on the key features, requirements, limitations, and practical use cases explained in this guide.

How do I get the best results with a Computer Host File and How to Edit a Host File?

Follow the recommended steps, use current software or information, confirm compatibility, and review settings before major changes.

Are there any risks or limitations?

Potential limitations depend on compatibility, data quality, cost, privacy, support, and how the product or method is used.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.