Updating windows hosts file

Note: We also have tutorial articles on how to edit a hosts file in Windows 7 and on a mobile device running Windows RT.The Hosts file contains lines of text consisting of an IP address in the first text field followed by one or more host names or fully qualified domain names (FQDNs).

updating windows hosts file-82

These applications may use it to redirect traffic from the intended destination to sites hosting malicious or unwanted content.

For example, lets say you wanted to prevent your computer (or someone else’s computer) from accessing a site called

Each field is separated by white space (blanks or tabulation characters).

Comment lines may be included; they are indicated by a hash character (#) in the first position of such lines. For example, this is how my local Hosts file looks like: The HOSTS file may present an attack vector for malicious software, and it may be modified by malicious software such as adware, computer viruses, or trojan horses.

but i need to update host file by the Ip every time it change because this application cant be modified .

so i need to modify the host file with the new ip by batch file and i find a solution and i will attach bellow but i need it to resolve the host ip and type it in the batch automatically , any idea?

This is how the HOSTS file looks on a Windows 10 Technical Preview build machine: The HOSTS file may sometimes be used by malicious software such as adware, computer viruses, or trojan horses etc. For example, adding a line that translates 192.168.1.1 to “kuku”.

These applications may use it to redirect traffic from the intended destination to sites hosting malicious or unwanted content.

If you have to revert back to Original - use batch file "Reverthosts.bat" with following contents del c:\windows\system32\drivers\etc\hosts ren C:\windows\system32\drivers\etc\hosts_original c:\windows\system32\drivers\etc\hosts Marcina Microsoft is conducting an online survey to understand your opinion of the Technet Web site.

If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.

That is why some Anti-Virus programs may monitor changes to the HOSTS file, preventing malicious software from modifying it.

Tags: , ,