The Windows hosts file is a plain text file on your Windows personal computer that can be manually maintained by you as an administrator. Although optional, the hosts file has been retained in Windows 11 and 10 to help manage any web site, server network address, ad trackers, spyware, and Trojans. This easy-to-understand guide details what the window hosts file is and how to open and edit it .
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 ) .
Windows Hosts File Windows11 What Is Hosts FileWindows Hosts File Windows11 What Is Hosts File 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 .
Windows Hosts File Windows11 What Is Hosts ContdWindows Hosts File Windows11 What Is Hosts Contd 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 .
Windows Hosts File Windows11 Etc Hosts File LocationWindows Hosts File Windows11 Etc Hosts File Location 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 .

  1. 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.”

Windows Hosts File Notepad AdminWindows Hosts File Notepad Admin

  1. 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.

Windows Hosts File Notepad Admin OpenWindows Hosts File Notepad Admin Open

  1. 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.

Windows Hosts File Notepad Admin Filetye TextdocumentWindows Hosts File Notepad Admin Filetye Textdocument

  1. 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.

Windows Hosts File Notepad Admin All Files OpenWindows Hosts File Notepad Admin All Files Open

  1. The hosts file will populate Notepad in Admin mode. You can freely edit this document and save it without encountering errors.

Windows Hosts File Notepad Admin ModeWindows Hosts File Notepad Admin Mode

  1. 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.

Windows Hosts File Windows11 Open Right ClickWindows Hosts File Windows11 Open 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 .

  1. Open the hosts file in Notepad in Admin mode.
  2. 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.

Windows Hosts File Copy 1st LineWindows Hosts File Copy 1st Line

  1. 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.

Windows Hosts File Copy Pasted 1st LineWindows Hosts File Copy Pasted 1st Line

  1. To start adding entries in the hosts file, simply paste a new domain name instead of localhost. You can also modify the IP address.
  2. Press Enter to add a new line.

Windows Hosts File Admin Mode Entries AddedWindows Hosts File Admin Mode Entries Added

  1. Once you’re done editing the hosts file in Notepad admin mode, be sure to save the entries.

Windows Hosts File Windows11 Save EditsWindows Hosts File Windows11 Save Edits 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 .
Windows Hosts File Saving Error Non Admin ModeWindows Hosts File Saving Error Non Admin Mode 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 .

  1. Open the hosts file in Notepad as an admin user.
  2. 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.

Windows Hosts File Browser Sites Being BlockedWindows Hosts File Browser Sites Being Blocked 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.

Windows Hosts File Website Blocked Thru Hosts FileWindows Hosts File Website Blocked Thru Hosts File 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 .

  1. Open the Windows hosts file in Notepad in Admin mode.
  2. Insert the name of the website you want to redirect elsewhere. Our example will replace “nytimes.com” with “bbc.com.”

Windows Hosts File Browser Redirection Redirect Browser NameWindows Hosts File Browser Redirection Redirect Browser Name

  1. Open Windows Command Prompt and enter the following text in the window.
  1. 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.

Windows Hosts File Browser Redirected Website Ip AddressWindows Hosts File Browser Redirected Website Ip Address

  1. 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.
  2. Save the hosts file and go back to a browser for testing.

Windows Hosts File Browser Redirected Ip In Notepad.pg Windows Hosts File Browser Redirected Ip In Notepad.pg

  1. 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.

Windows Hosts File Redirected Website Using HostsWindows Hosts File Redirected Website Using Hosts 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 .
Windows Hosts File Malware Spam LinksWindows Hosts File Malware Spam Links 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 .

  1. Open the hosts file in Notepad in Admin mode.
  2. Select all the non-default entries, which are the remainder text below the localhost lines.
  3. Delete the entries and save the hosts file. It is now cleared for reuse.

Windows Hosts File Clear Hosts FileWindows Hosts File Clear Hosts File

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 .

  1. Open any Notepad document in Admin mode and copy-paste the following text below.
  1. Save the above entry on the Desktop or any other PC location apart from the “etc” folder in System32. Name the document as “hosts.”

Windows Hosts File Save DesktopWindows Hosts File Save Desktop

  1. Go back to the hosts file in the “etc” folder and rename it as “hosts.old.”
  2. Transfer the newly created hosts file into the “etc” folder to make it the default hosts file again.

Windows Hosts File RenameWindows Hosts File Rename

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 .

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

generator : https://themedipia.com
Category : Website hosting

Leave a Reply

Your email address will not be published.