Computers Windows Internet

What the lmhosts file should look like. Secrets of the hosts file. What files are in the C: \ Windows \ System32 \ drivers \ etc directory, and what are they responsible for

This file defines the mapping of domain names to IP addresses. For what practical purposes can the hosts file be used? To speed up your work on the Internet by bypassing the DNS server for frequently visited pages and blocking access to some unwanted sites, as well as prohibiting access to the addresses of banner exchange networks.

Web developers are another example. Find "hide protected files operating system" and " hidden files and folders "and make sure the former is not installed and that the latter is set to Show hidden files, folders and drives. If necessary, the settings can be easily changed in such a way as needed. Look at the attributes section of the General tab. The file is write protected if read-only is checked.

Users just need to execute the program as soon as they have downloaded it to their local system. The main advantage is that they don't have to go through the manual process this way. Please note that you need to save your changes before they become available.

By default, this file contains only one entry: 127.0.0.1 localhost
This file may also contain a brief Microsoft help with the rules for adding new records.

The rules are as follows:
Each element must be on a separate line. The IP address must be in the first column, followed by the corresponding name. The IP address and hostname must be separated by at least one space. In addition, comments can be inserted in some lines; they must follow the node name and be separated from it with the # symbol. That is, everything that is written after the # sign is treated as a comment and is ignored when processing the file.

Before we dive into the process of modifying this important system file, let's learn a little about it so you can understand what you are doing and what its implications will be. You can view the file by going to the following path. The original file is approximately 824 bytes in size. If you block a website inside this file, you will no longer be able to view it.

The introduction is done, and now you are familiar with this new friend, right? You can see it in the image below. Now that you've found it, let's see how you can change it. Before you can edit this file, two prerequisites must be met.

A bit of theory. If you type in address bar browser site address, then first the browser contacts the DNS server, which converts this regular address into the IP address of the requested server. At this moment, the status bar of the browser says: "Searching for a node ...". If the requested node is found, the text "Node found, waiting for a response ..." is displayed in the status line, and a TCP connection is established using the standard port for this service.

Disable your antivirus software temporarily. ... Now you can follow the various steps below according to your requirements. If you want to block access to any particular site, you can simply add its entry to the end of the file as follows.

Sometimes viruses or adware can affect your hosts file to redirect you to malicious websites.


This is especially true for laptop users who travel or bring their work machines home. This is a simple text file commonly referred to as hosts.

Acceleration of work on the Internet can be achieved by comparing explicitly in the hosts file domain names frequently visited resources to the corresponding IP addresses. This will allow you not to contact the DNS server, but to immediately establish a connection.

You can find out the IP address of the desired node using the ping program (... / WINDOWS / system32 / ping.exe). For example, to find out the IP address of the site www.yandex.ru, type cmd.exe in the command line and click OK, in the window that opens, type the command ping www.yandex.ru. You will receive ping statistics for this node and the IP address of the site. Also, to get an IP address, you can use special utilities third party developers.

Each of the fields is separated by white space whitespace, which is preferred over formatting space, although spaces can also be used. Typically, most computer users will never need to change their hosts file, but sometimes it does. To modify these files, you first need to identify these files. It can be found by following the path. Changing or editing these hosts can be done by following the steps below. You can also temporarily disable your antivirus software as this could be flagged as suspicious activity.

The question may arise: is it not easier to add IP addresses to favorites replacing the usual www addresses? No, it’s not easier, because in many cases, when you try to connect like this, you will see an error message. The fact is that many servers use virtual hosts, when several virtual web servers can be located at the same IP address. These virtual servers are usually distinguished by third-level domain names.

Further, in accordance with the requirements, a number of functions can be performed. Instances of these can be seen when traffic is redirected from targeted destinations to other malicious websites. In cyber communities, this is commonly known as host file hijacking.

Two methods can be used to prevent this. The first option is to simply install a reliable and reputable anti-virus software... Make sure the path and file name are correct. In such cases, go to Notepad from the Start menu and select Run as administrator. Each computer in the broadcast area is responsible for complex attempts to register a duplicate name and respond to name queries for the registered name. Each of these files is also known as a host table.

To block unwanted sites, you can assign this site the address of your own computer: 127.0.0.1 When accessing such a site, the browser will try to load it from your computer, as a result of which an error message will be displayed. In the same way, you can block banners by listing the list of banner networks and assigning the address 127.0.0.1 to them.

Domain name resolution. Hope this will fix it up a bit. As always, if you think what needs to be added or changed, let me know. The address and computer name # must be separated by at least one space or tab. Each field is separated by a space. Entire blank lines in the file are ignored.

These applications can use it to redirect traffic from intended recipients to sites hosting malicious or inappropriate content. However, if you like other, more advanced text editors, you can try one of the two excellent free tools: "Notepad" and "Notepad2".

Example hosts file:

127.0.0.1 localhost # your computer's address
213.180.194.113 mic-hard.narod.ru # specify the address to speed up the loading of the site www.mic-hard.narod.ru
127.0.0.1 bs.yandex.ru # block Yandex banners

I can not enter Vkontakte

This question is asked every day by thousands of users on various forums. In most cases, a window appears on the user's computer where it is proposed to send an SMS message, after sending it, which promises to restore access to your favorite site. Another variant of events is also possible. Access to your favorite sites is blocked without any warnings and extortion of money. What to do in this case? How to regain access to your favorite site? Today we will take a quick look at one of the solutions to this problem.

This is good because they do not allow malware to modify it. However, it will now also be blocked. You will receive an "Access Denied" error. Edit the file, do whatever you need to do, then save and close the file on your desktop.

  • Then copy and paste the file to its original location.
  • You will be prompted to overwrite the file.
  • Select Replace File At Destination.
In this method, you can use Notepad and open it with administrator credentials, also known as elevated permissions.

First of all, I want to inform users of the following news. The developers and owners of the resource "vkontakte.ru" do not plan to collect money for access to their site. Therefore, any message on the screen of your monitor that all profiles will be deleted, and access to social network prohibited - an attempt to mislead you, extortion of money.
Now let's talk about measures to counter cybercriminals.

In the Start menu, find Notepad. ... Of course, you can edit the file as many times as you want to make the necessary changes. Note. We also have tutorials on how to. Open your copy from your desktop in Notepad. As you saw in the first chapter, broadcasting - be it viewing or registering name and resolution - does not easily cross multiple subnets. In addition, many broadcasts tend to paralyze networks. Thus, from each point on the network, requests for name registration and resolution can be directed to a single machine, rather than to the broadcast.

If you see a message on your monitor that you need to send an SMS in order to get the access code to the Vkontakte website, keep in mind that a Trojan has settled on your computer, which carefully collects information about which sites you visit, which passwords you enter. Moreover, a significant part of this information has already been collected.

You should never change the default. ... The username for the connection is usually "Administrator". The command prompts for the admin password, and after entering the domain, the domain should be successful. Both should work if the domain entry was successful.

Authentication will not work because the passphrase is sent in plain text. This helped me a lot. The last two lines are crucial. Connections have also been established. It is displayed in either decimal or hexadecimal form. Unfortunately, numbers for the human brain are difficult to understand and remember. Therefore, a person prefers to use names to designate and identify a thing.

The first priority is to disable the Trojan. The initial stage of work, I would deduce in two simple points:

1.Disable suspicious processes in the computer memory
2.Remove suspicious programs from startup

I highly recommend reading the previously written article "How to remove a virus from a USB flash drive", where the two above questions are exactly considered.
If you have successfully solved the two points I have given, you should attend to the installation antivirus software... What if the antivirus software is already installed on your computer? Feel free to remove it and reinstall it.

It is easier for them to remember and understand. However, today it is impossible to address a computer directly with its name over the network. For this reason, methods have been developed to convert name translations to numeric addresses. This process is called name resolution. Name resolution is usually done using a directory or database. Most often, decentralized client-server systems are used, which work in accordance with a hierarchical sequence of requests with different areas of responsibility.

Since this file must be maintained manually, you only temporarily enter the addresses and names of the local systems. The following procedure is intended to illustrate possible name resolution. In some systems and in practical applications, the process may differ from this. The procedure assumes that only the responsible name server can respond to the original name resolution request. In practice, it is often the case that name resolution can be successfully resolved by a resolver.

Which antivirus is better? The best antivirus in this situation, there will be one that was not installed earlier.

Be sure to update the databases after installation. In due time I was helped in such a situation by the famous program from Kaspersky Lab - Kaspersky Internet Security 2009, but this does not mean that the famous Kaspersky is the best one for solving our problem. Each antivirus has its own drawbacks and advantages. Which one suits best is up to you.

To get permission to edit the host file

  • In general, it is a router for Internet access.
  • Buffered proxy.
For example, computer names are known in local network... You can learn how to edit host file successfully here. If you don't want this, follow these steps to edit the host file.
  • Enter "Editor" in the search box.
  • Make a click right click mouse on the entry "Editor".
  • Select "Run as administrator".
  • An editor window will open.
If you opened the editor as an administrator, you can go to the sections: edit the host file.

After all the above activities have been carried out, you need to proceed to the most important thing - editing the hosts file. You can read more about this file here.
Our first priority is to find this file on your computer.

If your operating system is installed on the C drive, then the path to the file will be as follows:

C: \ WINDOWS \ system32 \ drivers \ etc

With a double cross, you can also write comments and notes that are just for you as information. For example, you can no longer manipulate the page in the browser. For some products, you still have a choice between Direct Install and Download. For correct installation software, you usually have to download all the proposed files to your computer. Close your web browser to log out of the server. Typically, products are in a compressed form so that the entire product is stored in a file. After unpacking, you can start the installation in the appropriate directory.

  • If you want to add new entry, make it below the comments.
  • You must be connected to the data network of the University of Vienna.
  • You must have a web browser installed.
  • Below you will find information on direct installation.
  • Always upload files to a new directory on your hard drive.
However, the following prerequisites must be met.

This folder should contain the hosts file. The file has no extension. To edit it, right-click on the file, select the "Open" item and then a list of programs will be offered in a new window.

Here we are looking for the Notepad program. Select it with the mouse and click the "OK" button.
Before showing what the wrong hosts file should look like, I want you to know the contents of the original file:

If you are sure that you want to run the program, even if you do not know the object you want to check, answer “Yes”. Wait a little longer for the installer to start.

  • There is the directory you are looking for.
  • If it exists, open it with a text editor.
Personal integration. This is the default.

However, if this is not the case, you can run the following command line... Otherwise, specific resolution of the computer name is only possible when it is installed. Then the command line is enough to enable the command line. The script must be executable and can.

# Copyright 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:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

Name resolution with broadcast messages

In this case, however, you must ensure that no programs running on the share are currently running, as they will automatically terminate later, resulting in data loss. It is recommended that you do not change the default paths created during installation. A typical directory structure would look like this.

This measure not only frees up from the lack of space, but also makes it easier to call in the browser

The correct index file must be present. ... Then open the file text editor and paste the following. Notes. A document search provides examples of entries and comments, which are always prefixed with a diamond. This requires entries with the following syntax.

127.0.0.1 localhost

It is with this text that the file is filled after the installation of the Windows operating system.
Now we look at our current file using the Notepad program. On an infected computer, it may well look like this:

Note that 127.0.0.1 is opposite to the domain names of the sites. In fact, every line like: "127.0.0.1 vkontakte.ru" blocks access to a specific site. In this case, it is the social network Vkontakte.ru.
Now our task is to select all the contents of the hosts file and delete all the text that has opened to our eyes. Next, copy the original hosts content from our site. I brought it to your attention for review above. And we insert it in place of the data we just deleted. Here's what we should get:

Close Notepad. When asked to save the file, we answer "Yes".

We reboot the computer. And we try to enter the desired site. According to my observations, in 20-30 percent of cases, the above actions lead to a positive result.
However, there is also a more complicated option. So, suppose you went to the C: \ WINDOWS \ system32 \ drivers \ etc folder and you see the following picture there:

As we can see, the hosts file does not exist here! We see that a certain lmhosts file is located in the folder, which the hand is trying to rename into hosts. I do not advise you to do this, as this operation will not lead you to a positive result.
In this case, you need to perform the following set of actions: in the main menu Windows explorer go to the main menu Service and select the item "Folder Options".

Go to the "View" tab and uncheck the box next to the following items:

- Hide protected system files
- Hide extensions for registered file types
Now we click on the switch opposite the inscription "Show hidden files and folders."

Therefore, we will do it easier. Let's delete the hosts file altogether. Select it with the mouse and press "Shift + Delete" on the keyboard. Thus, our file is deleted forever, bypassing the trash.
Now let's create the hosts file again. To do this, in the C: \ WINDOWS \ system32 \ drivers \ etc folder, right-click on an empty space and call the context menu.
Choose: Create - Text Document

A file with the name Text document.txt will appear. Completely delete the name and extension of the file and enter simply hosts. For a request to change the extension, we answer "Yes".

Now we paste the contents of the original hosts file:

Just delete the lmhosts.sam file. We reboot the computer. Our Vkontakte website should open.
If this has not happened for you, please describe the problem in detail on our forum.

In fairness, it should be noted that the above recipe will work not only for the Vkontakte social network, but also for the Odnoklassniki social network and other frequently visited Internet resources.

In contact with

The point of using the Lmhosts file was to translate NetBIOS names using the netbt driver. sys without broadcast requests. The Lmhosts file is normal text file which lists the hostnames and IP addresses. Consider an example of this file with information about three servers, two of which are COMPANY domain controllers.

# Lmhosts file for Domain COMPANY 10.1.1.10 DC01 #PRE #DOM: COMPANY 10.1.1.20 DC02 #PRE #DOM: COMPANY 10.1.1.3 0 PR03 #PRE 10.1.1.100 PR04 #PRE #BEGIN_ALTERNATE #INCLUDE \\ PR03 \ PUBLIC \ ETC \ Lmhosts #INCLUDE \\ DC02 \ PUBLIC \ ETC \ Lmhosts #END_ALTERNATE

The hash (#) character has two functions.

■ Used before the standard Lmhosts file options (#PRE, #DOM, and #INCLUDE).

■ It is interpreted as the beginning of a comment if no parameter is specified after the symbol.

Let's look at the standard parameters for the Lmhosts file. The parameter must be written in uppercase. Otherwise, it is considered a comment.

■ #PRE. This parameter causes the system to load the appropriate entry into the NetBIOS name cache at boot time. This speeds up initial name translations.

■ #DOM. This parameter marks the entry as matching a domain controller. The domain name is specified after the colon. If the Lmhosts file is used on a domain, this parameter is required because it tells the local client the addresses of the authentication servers.

■ #INCLUDE. This parameter forces the tcpip driver. sys load the Lmhosts file from another computer. The #INCLUDE parameter allows you to maintain a single central copy of the Lmhosts file that will be used by all workstations within working group... The entry is in UNC format, for example \\ SRVl \ Public, where Public is the name of the resource. It is worth paying attention to the trap that exists in this mechanism. The UNC name contains the NetBIOS name, so this name must be written in local file Lmhosts.

■ #BEGIN_ALTERNATE and #END_ALTERNATE. These parameters are used to separate multiple entries within the # INCLUDE parameter. If there is only one # INCLUDE parameter in the file, these parameters are not needed.

Using the Lmhosts file

The Lmhosts file should only be used as a last resort. Such static recordings become time bombs and haunt the administrator like the crocodile pursued Captain Hook. One day the administrator forgets about the created record, and bang - it worked at the wrong moment.

As stated earlier, there are several common uses for the Lmhosts file. For example, some administrators use the Lmhosts file for name resolution on dial-up connections. With a dial-up connection, you can use WINS translation, but often this translation is not enough.

Effective and requires too much effort to set up. A short entry in the Lmhosts file on a dial-up client keeps track of the domain controllers and servers that the client uses to establish connections.

Instead of using an Lmhosts file to resolve the name on a mapped drive, you can specify the IP address directly in the UNC name. For example, instead of connecting a resource named \\ Srvl \ Users \ LLuthor and using the Lmhosts file to convert \ Srvl to 10.1.1.43, you can specify the name \\ 10.1.1.43 \ Users \ LLuthor. Users will have to reconnect when changing the server's IP address network resource, but this is usually easier than making changes to the Lmhosts file.