# Patch your windows hosts file. # During installation: Select trial version. After the install, run the program, then enter the serial. Patching the hosts file: Windows XP: 1. Open notepad: 2. Open windows system32 drivers etc hosts: 3. Append the following text to the file: 6. Click on text files and then on all files: 7. Click save file and close Notepad: Code. To access the hosts file in Windows 7 you can use the following command in the Run Line to open notepad and the file. Notepad c: windows system32 drivers etc hosts. Once notepad is open you can edit the file. In this example we will block Facebook. To do this just enter in the following after the # mark. 0.0.0.0 www.facebook.com.
On Windows 10 Host file is an important system file which maps the host/site names with its IP addresses. Basically, it translates the hostname to IP and IP to hostname. In other Words, the host file is similar to using a phone book to find the matching phone number of a specific person’s name. Host file is a plain text file without any file extension. On Windows computer, We can edit host file on Windows 10 For custom domain redirects, block websites, or remove malicious entries set by malware. It functions as a local copy of a DNS server.
Post Contents :-
- 1 Edit hosts File on Windows 10
Edit hosts File on Windows 10
While Domain Name System – or DNS – is mostly used for this function (being a centralized and half-automatically managed name resolution system), the HOSTS file can be used as a local name resolution mechanism, and when used in conjunction with other name resolution mechanisms such as DNS, the HOSTS file takes precedence over them. In short, your host file is a form of DNS. Your computer actually looks for your host file before hitting the internet and finding the site you’re searching.
Location of the Hosts File
In Microsoft operating systems, the HOSTS file is located in the following location:
C:WindowsSystem32Driversetc
How To Edit Hosts file
Some Times we need to edit the Hosts file, For Different purposes like custom domain redirection, block certain websites, or remove malicious entries set by malware. We can modify the host files using Notepad but, As This is a system file we cant modify this with a normal user account, We need administrator rights. For this, we need to open Notepad As ( Admin )
- On Start menu search type notepad,
- Right click on notepad and select Run as Administrator.
- Here on note pad click on file Select open
- Browse for the following path : C:WindowsSystem32Driversetc
- Here Select All Files from the drop-down menu and double click on hosts file.
![Adobe Host File Adobe Host File](/uploads/1/2/5/2/125247216/141744956.jpg)
This will open Host files As Shown Bellow image.
- Here you can custom Redirect domain names,
- Block Certain websites ( Domain )
- remove malicious entries set by malware.
Note: To modify the hosts file, you need to add two entries, including the IP address of the remote host or application to a the friendly address you want to use. for ex : Type the IP address of the remote host or local host followed by the domain or computer name you want to use to reach the device or application. Then Click on File, and select Save.
How the Hosts File Works
The Host File contains lines of text that are made of IP addresses followed by one or more host names or fully qualified domain names (FQDNs). Each field is separated by white space (blanks or tabulation characters).
For example, if you wanted to use the HOSTS file to translate a host name of a computer called “FTPserver” into the IP address of 192.168.1.100, Then We need to Add Bellow line:
192.168.1.100 FTPServer
The HOSTS file can also translate Fully Qualified Domain Names (or FQDNs) of computers, such as ones used on the Internet.
For example, if you wanted to add a manual line to translate a FQDN of a computer called “webserver.domain.com” into the IP address of 11.06.23.100 you would add this line:
11.06.23.100 webserver.domain.com
When you ping it, your computer will resolve the name to the correct IP address:
![Cs6 Cs6](/uploads/1/2/5/2/125247216/262635778.png)
Redirect a Website Using Host File
You Can Redirect Any Website to Another website by modifying the Host file. For Ex: you want your To Redirect YouTube.com to Twitter.com Means when you open Youtube.com on your web browser it automatically redirects to twitter.com.
For this first, we need the Twitter’s IP address. we can Get this by using the ping Command. Open the command prompt by click on Start type cmd and hit the enter key. Now type ping twitter.com -t you will see the twitter.com numeric IP address.
Now on Host file Add the Twitter IP Space and The Domain Name
104.244.42.193 youtube.com
This line tells our computer to connect Youtube.com to Twitter’s IP address. Type Youtube.com you’ll end up at Twitter!
Create Website Shortcuts using the Host file
You can also modify host file to create “shortcuts” that quickly access websites from any program on your computer. For example, if you’re a Twitter addict, you can associate “t” with Twitter – type t in any web browser’s address bar and you’ll instantly end up at Twitter.
You can also create shortcuts with multiple letters, such as twit. You don’t need a .com, .net, .org, or any other type of extension. However, you can’t use spaces.
To do this, just add the following line to the hosts file and save it:
104.244.42.193 t
Now you can type t into any program’s address bar and you’ll end up at twitter.com.
Block websites using host file windows 10
If you want to block your computer from accessing certain websites, you can use the loopback address (127.0.0.1) followed by the domain name (e.g., 127.0.0.1 website.com)
simply add the following entry on Host file and save.
127.0.0.1 blocksite.com
Ex : 127.0.0.1 facebook.com
127.0.0.1 youtube.com
Remove malicious entries set by malware
Also Sometimes Due to Virus / Malware infection you may notice certain Websites not open on your computer. This is Because malware automatically edits your Host file and make Different entries for Domain Redirection (Ex: Any domain Name automatically Redirect to specific Website ) or Block some websites.
Simply open Host file on Notepad and Clear Other entries set by Malware adware. And left the default entries as shown bellow host file.
Lock Hosts file to prevent hijacking
As some times malware/ Adware redirect web address by altering your host files. A good latest updated antivirus can prevent this hijack but if you want to add another layer of security then the second option is to lock the hosts file so no other program or user except you can rewrite to it without unlocking it.
To prevent Host file hijacks, you may navigate to it, right-click on it, select Properties and make it a Read-only file. This will lock down your Hosts file and prevent anyone or any malware from writing to it.
That’s All About edit hosts file on Windows 10. Note that after make any modification on Host files Restart windows to take effect the changes you have done. I hope now you can easily Modify, Edit hosts file on Windows 10 to Custom Domain Redirection, Block Different Websites etc. Feel any Difficulty while edit host files discuss on comments bellow. Also read:
The Windows HOSTS file functions like a local copy of a DNS server, so knowing how to edit it might come in handy if you want to make custom domain redirects, block websites, or remove malicious entries set by malware. That said, you might run into permission issues and other problems when trying to make changes to this file in some versions of Windows.
The instructions in this article apply to Windows XP, Windows 7, Windows 8, and Windows 10.
How to Edit the Windows HOSTS File
In Windows 7, 8, and 10, you can't save edits to the HOSTS file unless you open it directly from Notepad or another text editor. To do so:
- Open Notepador another text editor like Notepad++.
- In the text editor, select File > Open and navigate to the HOST file location at C:WindowsSystem32driversetc.Copy and paste the path to the HOSTS file into the File name field to quickly find the folder without having to browse for it manually.
- Select Text Documents (*txt) in the bottom-right of the Open window and change it to All Files.This step is required because the HOSTS file doesn't have the .TXT file extension.
- When files appear in the folder, double click hosts to open it.
- You can now edit the HOSTS file and save any changes.
What If I Can't Save the HOSTS File?
In some versions of Windows, you don't have permission to save directly to theetc folder. If this is the case, you might see an error like this one when you try to save:
Instead, you must save the file elsewhere like the Documents or Desktop folder. After saving, go to that folder, copy the HOSTS file, and paste it directly into the location where the HOSTS file should be (C:WindowsSystem32driversetc). You'll be prompted with permission validation and will have to confirm overwriting the file.
If you still have trouble saving the modified HOSTS file, check the file's attributes to see if it's been marked read-only. Right-click the file and select Properties to see the attributes.
Another option is to open your text editor program as an administrator so that the permissions are already applied to the editor. Then, saving the HOSTS file over the original can be performed without having to verify your admin credentials.
If you still can't save to the HOSTS file location, you probably don't have the correct permissions to be editing files in that folder. You should be logged in under an account that has administrative rights over the HOSTS file, which you can check by right-clicking the file and going to the Security tab.
What Is the HOSTS File Used For?
The HOSTS file is the virtual equivalent of a phone company's directory assistance. Where directory assistance matches a person's name to a phone number, the HOSTS file maps domain names to IP addresses.
Entries in the HOSTS file override DNS entries maintained by the ISP. While this might come in handy for regular use, like to block ads or certain malicious IP addresses, its functions also make this file a common target of malware.
By modifying it, malware can block access to antivirus updates or force you to a malicious website. Thus, it's a good idea to check the HOSTS file periodically or at least know how to remove false entries.
A much easier way to block certain domains from your computer is to use a custom DNS service that supports content filtering or blacklists.