Also read: How to Be More generative with Hot Corners in Windows
What Is the Windows Hosts File?
If you ’ ve ever used a phone company ’ randomness directory, you ’ vitamin d know how it maps any earphone record to a singular person, business or residence. In the lapp manner, the hosts file in any manoeuver system matches IP addresses with unique domain-based hostnames ( or websites ), server diagnose, proxies, and more.
In Windows systems, as with Linux or Mac, the hosts file ’ s chief purpose is to enable simpleton IP address map of hostnames and servers. therefore, it is alike to the Domain Name System ( DNS ) .
Each hosts file entrance follows the default localhost entrance in a offprint line. Each line is preceded by a hash ( # ) symbol that allows you to insert comments. The real applications of the Windows hosts file requires you to omit the # signboard .
Also read: How to Capture a Scrolling Screenshot in Windows
Where Is the Hosts File on Windows?
The Windows hosts file is always found at “ C : \Windows\System32\Drivers\etc. ” It ’ s a textbook file that is not associated with any platform. You can well open it with Notepad though .
Note : If you try adding another charge with the list “ hosts ” to the “ etc ” folder, it will have negligible impact on the original hosts file process, as you ’ re plainly renaming it as another duplicate file .
How to Open the Hosts File in Windows as Administrator
The only way to open the hosts file in Windows as the administrator is to use Notepad. The reason you need Admin access is that the hosts file ’ mho inner entries can only be managed by users with the highest admin privileges .
- Go to the Search menu in Windows and open Notepad as administrator. If the admin option is not visible to you, click the down arrow symbol. Also, If you’ve saved the Notepad shortcut in another PC location, you can open it by right-clicking on the app symbol and selecting “Run as administrator.”
- Once the blank Notepad file is open, go to “File -> Open” to search for files on your PC that work with Notepad in Admin mode.
- Navigate to the folder “C:\Windows\System32\Drivers\etc.” You may not see anything at first. Click on a tiny text document’s menu item to reveal more options.
- Select “All files” in the menu option chosen above. Now the hosts file is clearly visible along with any other files. Choose the correct hosts file in Notepad Admin mode while avoiding any duplicates.
- The hosts file will populate Notepad in Admin mode. You can freely edit this document and save it without encountering errors.
- If you only wish to check the hosts file and not edit it, you can directly open it with Notepad from a simple right-click.
Also read: How to Boot to Safe Mode in Windows
How to Edit My Hosts File in Windows
here we will learn how to modify the hosts file in Windows, which is how the end use applications are served .
- Open the hosts file in Notepad in Admin mode.
- The hosts file’s horizontal entries are separated by a space or tab. To ensure there are no errors due to syntax issues, select the entire block of text including 127.0.0.1 and localhost but not the hash (#) symbol.
- Copy-paste the IP address and localhost in a new line. You can add it next to the default previous entry. To keep the hosts file clean, it’s best to add some paragraph spacing.
- To start adding entries in the hosts file, simply paste a new domain name instead of localhost. You can also modify the IP address.
- Press Enter to add a new line.
- Once you’re done editing the hosts file in Notepad admin mode, be sure to save the entries.
Note : if you forget to edit the hosts file as an admin drug user in Windows, you will encounter a “ You don ’ t have permission to save in this location. Contact the administrator to obtain license ” message .
Also read: Can ( and Should ) You Continue to Use Windows 8 or 8.1 ?
Applications of the Windows Hosts File
As the hosts file can override the DNS server, it can achieve boost objectives, such as blocking or redirecting any web site or URL of your option .
1. Edit Windows Hosts File to Block Websites
You can use the Windows hosts file to remove time-wasting URLs, entertainment sites, and other websites you don ’ thyroxine want to visit. Don ’ metric ton want to spend time on Netflix ? Simply block it wholly at a system degree .
- Open the hosts file in Notepad as an admin user.
- Populate the list of websites you want to block in the format
127.0.0.1 domain. Follow it by saving and exiting the Notepad file.
There may be a time you need to block multiple domains of the like avail as individual entries in the hosts file. For model, it treats “ twitter.com ” and “ m.twitter.com ” as two discriminate entries .
After you save the list of jam websites in Notepad, you won ’ t be able to access it on a browser again unless you edit the hosts file to regain access. This blocking method is supported on Google Chrome, Microsoft Edge, Firefox, Opera and many early browsers. It is very crucial to delete the browser hoard after blocking the web site in the hosts file, otherwise, it will keep loading again.
Read more: Medical Website Hosting | RemedyConnect
apart from the major browsers, you can besides block websites on less-used option browsers such as SlimBrowser .
Also read: How to Block Websites on Chrome, Firefox, Edge, Safari, Android, and io
2. Edit Windows Hosts File to Redirect Websites
You can use the Windows hosts file to redirect any web site to another URL. This may not always be supported due to security certificate conflicts .
- Open the Windows hosts file in Notepad in Admin mode.
- Insert the name of the website you want to redirect elsewhere. Our example will replace “nytimes.com” with “bbc.com.”
- Open Windows Command Prompt and enter the following text in the window.
- The above command will generate a series of replies from the end website while revealing its IP address. Sometimes you may see an IPv6 address instead of IPv4 as shown in the below example.
- Once the IP address is found, go back to the hosts file and change the 127.0.0.1 entry for the website you want redirected, replacing it with the IP address generated in the Command Prompt.
- Save the hosts file and go back to a browser for testing.
- After setting the redirection property for any website, you will see a redirection message. Sometimes it’s an error, as the security certificates of the two sites do not match. This is why its main purpose is to redirect an entertainment or non-productive site to a company homepage or your own server address.
Also read: 15 safe Websites for Downloading Windows Software
3. Spam and Malware Protection with Hosts File
The Windows hosts file can besides be used to manage multiple spam user links, third party sites, cookies, ad trackers, and surveillance bots. It can be used to keep malware sites at bay. Browsers such as Firefox give you a complete list of trackers and bots on any web page. If you want to frequent a web site while avoiding its spammy links, plainly add them as block entries in a server file .
Also read: Should You Disable “ Antimalware Service Executable ” Process in Windows ?
Frequently Asked Questions
1. Why is my hosts file not working?
Is Windows not able to read the hosts file on your calculator ? You may encounter this error when you don ’ thyroxine set the line endings by rights in Notepad as an admin drug user. It actually boils down to syntax errors in saving the entries. The good thing is these problems are very easy to fix .
To avoid potential errors in entries saved using the Windows hosts file, make certain you copy-paste the entire beginning sentence containing “ 127.0.0.1 ” and “ localhost ” in the default entry. Use it to modify each and every cable below .
2. How can I clear my hosts file in Windows?
Clearing the hosts file is very easy. This allows you to reuse the hosts file document barely as it was in a former state .
- Open the hosts file in Notepad in Admin mode.
- Select all the non-default entries, which are the remainder text below the localhost lines.
- Delete the entries and save the hosts file. It is now cleared for reuse.
3. How can I reset the Windows hosts file back to the default?
sometimes you may face errors in the Windows hosts file configuration, particularly after it was changed respective times. To undo these errors, it ’ s a good mind to reset the Windows hosts file back to its default country .
- Open any Notepad document in Admin mode and copy-paste the following text below.
- Save the above entry on the Desktop or any other PC location apart from the “etc” folder in System32. Name the document as “hosts.”
- Go back to the hosts file in the “etc” folder and rename it as “hosts.old.”
- Transfer the newly created hosts file into the “etc” folder to make it the default hosts file again.
4. Can I delete the Windows hosts file?
While the hosts file has a very herculean officiate in blocking websites, interestingly, it ’ sulfur barely an optional system resource in Windows 11/10. You can easily delete the hosts file from your personal computer without it affecting the personal computer operations in any way. You can always recreate a modern hosts file by resetting it as a default in Notepad using the method shown above .
5. Can malware affect the hosts file?
As the hosts file has a potent function to play in blocking and redirecting websites in Windows, it is a front-runner assaultive point for malware authors. sometimes even Windows Defender may incorrectly determine that the hosts file was changed by malware or spyware. In this case, you can exclude the hosts file from being scanned by Windows Defender while you correct the malware links inserted inside the file. Yet, in early cases, malware authors may name their malware after hosts and try to place it in the etc booklet .
persona credit rating : Pixabay
subscribe to our newsletter !
Our latest tutorials delivered square to your inbox
Sign up for all newsletters .