How To Add A Line To The Hosts File

Table of contents:

How To Add A Line To The Hosts File
How To Add A Line To The Hosts File

Video: How To Add A Line To The Hosts File

Video: How To Add A Line To The Hosts File
Video: How To Edit Hosts File in Windows 10 2024, November
Anonim

Windows series operating systems have a number of files that perform a specific task, for example, hosts. This file has no extension and is positioned as a text document. It is designed to store lists of domains that will be denied access to the Internet.

How to add a line to the hosts file
How to add a line to the hosts file

It is necessary

Windows computer

Instructions

Step 1

To find the hosts file, you need to open Windows Explorer, go to the root of the system drive and open the folder along the following path: WindowsSystem32Driversetc. The file is launched by double clicking on it. In the window that opens, select the program with which this document will be opened. It is recommended that you use any text editor such as Notepad or Notepad.

Step 2

In the document that opens, you will see a list of domains that have been entered by you or by the system. A standard list usually consists of several lines: firstly, lines starting with the characters "#", and secondly, containing the addresses themselves (via the value 127.0.0.1).

Step 3

If the document cannot be opened using standard programs, it is recommended to change the file properties. To do this, right-click on it and select "Properties". In the window that appears, uncheck the "Read only" item and click the "Apply" and "OK" buttons.

Step 4

To add your own line by creating an exception for a specific site, copy the line "127.0.0.1 localhost" and paste it on the next line (press the Enter key). The localhost value should be changed to the domain of the blocked site. Thus, the line will look like this: 127.0.0.1 site.ru. In some cases, the domain should be preceded by www - this rule is typical for older sites.

Step 5

Now press the keyboard shortcut Ctrl + S to save your edits to the hosts file. Restart your computer if you want to test the operation of this file. To unblock a site, you must remove the entire line with the name of its domain from this file. After deleting a specific address, the problem of the impossibility of saving such a file is encountered. In this case, you must completely delete the file and restart your computer.

Recommended: