Skip to content

How To Blog

  • Change Downloads Folder Location in Google Chrome How-To
  • How To Log Out Of Facebook Messenger On iOS & Android Computer Tips
  • HDG Explains – Swapfile.sys, Hiberfil.sys and Pagefile.sys in Windows Help Desk
  • Best calculator casio 2020 black
  • The female army height weight chart 2018

    The army height weight chart only for female or man in 2018. For more information visit : www.usa.gov Army Maximum Body Fat Standards for Women Army height and weight female.minimum height for army female.army height and weight form.indian army height and weight standards.army weight chart Age 17-20 = 30 %Age 21-27 = 32 %Age 28-39...<p class="more-link-wrap"><a href="https://blog.pkrtousd.gb.net/the-female-army-height-weight-chart-2018/" class="more-link">Read More<span class="screen-reader-text"> “The female army height weight chart 2018”</span> »</a></p>

  • How to overclock a monitor Computer Tips
  • How to Use Azure VM Scale Sets Microsoft Azure
  • How To Set Up Your Own Twitter-Like Website Using WordPress’ P2 Theme Web Site Tips

Edit the Windows Hosts File to Block or Redirect Websites

Posted on October 6, 2020 By blog_786 No Comments on Edit the Windows Hosts File to Block or Redirect Websites

The Windows Hosts file is the file that Windows uses to manage and map IP addresses. By editing the Hosts file, you can configure Windows to block or redirect specific websites and even the protocols used by programs and applications.

To start editing the Windows hosts file, you first need to find it. Open Windows Explorer and click This PC or My Computer. Double click C: then Windows folder and scroll down the page until you reach the System32 folder. Inside that folder, open the drivers and then open etc. Now you will see several files, one of which is hosts.

Edit the Windows Hosts File to Block or Redirect Websites

Now, notice that the file type for the hosts file is listed as File. Since there is no default program to open this type of file, double-clicking on the hosts file will simply prompt you to Windows asking which program you want to use to open the file.

In this request, you can edit the hosts file using Notepad. So, just click to select Notepad and click OK. From there, Notepad will launch with information about the hosts file.

Edit the Windows Hosts File to Block or Redirect Websites

This way of opening the hosts file was demonstrated to show where the hosts file is actually located in Windows, but you won’t be able to edit it because it’s a system file. To edit the file, you must first open Notepad with administrator rights.

Click Start and type Notepad, but don’t click Notepad to open it. Instead, right-click the Notepad list to open the context menu. Select the “Run as administrator” option.

Edit the Windows Hosts File to Block or Redirect Websites

With Notepad open, select File> Open. Go to C: Windows System32 drivers etc . You will see a blank screen displaying a prompt No items matching your query. Change Text Documents (* .txt) to All Files using the dropdown menu. Now you can select the hosts file and click Open.

Edit the Windows Hosts File to Block or Redirect Websites

It is very easy to add files to the hosts file. The hosts file uses the format:

IP address exampledomain.com

To block a website on Windows, just enter the following at the end of the hosts file:

127.0.0.1 www.exampledomain.com

So, if I wanted to block a website like www.nytimes.com, I could simply add the following line:

127.0.0.1 www.nytimes.com

Edit the Windows Hosts File to Block or Redirect Websites

We are actually telling Windows that the www.nytimes.com website should redirect to the IP address 127.0.0.1, which is just a loopback address on our local system. If you don’t have a local website set up on your computer, you’ll just get an error page in your browser.

Edit the Windows Hosts File to Block or Redirect Websites

Pretty cool, huh !? Obviously, you can see how it can be used in different ways: prank, parental controls, etc. If you didn’t want to block a website this way, you can also redirect it to another website. To do this, you first need to find the IP address of another site.

To do this, simply open Command Prompt (click Start and type CMD) and enter the following command:

ping examplewebsite.com

Edit the Windows Hosts File to Block or Redirect Websites

In my example, I sent a request to Adobe.com. IP address 192.150.16.117. Now I can just paste this number into my hosts file in front of www.nytimes.com.

Edit the Windows Hosts File to Block or Redirect Websites

Now when I visit www.nytimes.com I am redirected to Adobe.com! Nicely! Please note, if this does not work for the websites you enter, it might be related to the url you are using. For example, it matters if you use www.nytimes.com as opposed to nytimes.com without www. Visit the website and see exactly which URL of the website you want to redirect. You should always try without www first to see if that works.

If the website is using HTTPS like Google.com or something, it should still redirect if you are using the hostname. It is not possible to specify the HTTPS version of the website in the HOSTS file, but it should redirect the HTTPS and non-HTTPS versions of the website if you are only using the hostname (e.g. google.com).

Finally, you can use the hosts file to create simple shortcuts for your own devices on the network. For example, my router is on my home network at 192.168.1.3, but I could add the following line to my hosts file and just type myrouter.com into the address bar.

Edit the Windows Hosts File to Block or Redirect Websites

It doesn’t really matter if myrouter.com is a website or not, because the hosts file is read first and you will be redirected to the IP address specified in the file. It’s worth noting that not all browsers are able to use the hosts file, so if it doesn’t work it could be a problem. I tested it with IE, Microsoft Edge, Chrome and Firefox and it worked in all browsers.

Overall, the hosts file is still useful even on Windows 10. It also works great on Windows 8, 7, Vista, etc. If you have any questions, feel free to comment. Enjoy!

–

Computer Tips

Post navigation

Previous Post: How to Enable Two Factor Authentication for iCloud on iOS
Next Post: How to Create an Encrypted Disk Image in OS X

Related Posts

  • How to Minimize iTunes to the Windows Taskbar Computer Tips
  • how to read newspaper articles with a free subscription Computer Tips
  • Netflix audio out of sync 2021 fix it easy Computer Tips
  • How to Split a Large File into Multiple Smaller Pieces Computer Tips
  • How to embed video within video in Adobe Premiere Computer Tips
  • Internet commentary etiquette can enhance your social experience Computer Tips

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Archives

  • May 2023
  • April 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • March 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • December 2019
  • July 2019
  • May 2019
  • April 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018

Categories

  • Amazon Web Services
  • Apple Watch
  • Computer Tips
  • Cool Websites
  • Free Software Downloads
  • Gadgets
  • Gaming
  • General Software
  • Google Software/Tips
  • Hardware
  • Help Desk
  • How-To
  • iOS
  • iPad
  • iPhone
  • Linux
  • Linux Tips
  • macOS
  • MS Office Tips
  • Networking
  • Office Tips
  • OS X
  • Product Reviews
  • Reviews
  • Safari
  • Smart Home
  • Smartphones
  • Software Reviews
  • technology
  • text
  • Tools Review
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Urdu Books PDF
  • Web Site Tips
  • Windows
  • Windows 10
  • Windows 7
  • Wordpress

Recent Posts

  • How to Delete chrome History YouTube and Search Activity
  • How to remove widgets from the Notification Center in macOS Big Sur 2023
  • How to customize the Mac menu bar and usage
  • How to Access Shared Windows Folders on iPhone 2023
  • 6 Best iOS Reminder Apps 2023

Recent Comments

  1. 6 Best iOS Reminder Apps 2023 - How To Blog on How to Use Facebook Custom Friends Lists To Organize Your Friends
  2. 6 Best iOS Reminder Apps 2023 - How To Blog on How To Add Audio Narration To a Powerpoint Presentation
  3. 6 Best iOS Reminder Apps 2023 - How To Blog on free online courses with certificates of completion
  4. How to permanently delete A PS4 Account - How To Blog on Ultimate Guide to Troubleshooting PS4
  5. most expensive game console 2022/23 - How To Blog on 120Hz TVs and Phones Are Here: Do You Need It?
  • The 5 Best Alternative iOS Voice Recording Apps iOS
  • List of Useful Online Tools for Bloggers How-To
  • How to Format a Drive or Partition with the HFS+ File System OS X
  • USB Cable Types Explained – Versions, Ports, Speeds, and Power Networking
  • Best wrist calculator 2020

    Best wrist calculator 2020

  • Best calculator ribbon 2020

    Best calculator ribbon 2020

  • How To Send Encrypted Emails From Your Mac OS X
  • How to Add Comments to an Excel Worksheet Cell MS Office Tips

Copyright © 2023 How To Blog.

Powered by PressBook News WordPress theme

Go to mobile version