If you’re working on a website or blog, it’s important to make sure that your HOSTS file is correct. This file stores information about who can access your site and what devices they can use. If you make some mistakes in this file, your website or blog will be inaccessible to everyone. To correctly edit the HOSTS file, you’ll first need to understand what it contains. The HOSTS file is a text file that stores information about which devices can access your site and how they’re connected. Here’s an overview of the contents of the file: Name Type Description www.example.com A web server address www A list of devices that can access the site (PCs, phones, tablets) dev1 dev2 A list of devices that are connected to dev1 (PCs, phones, tablets) www-dev1 www-dev2 A list of URLs that point to the sites on dev1 and dev2 respectively

Edit Hosts File in Windows

To get started editing the Windows Hosts file, you first need to locate it. Open Windows Explorer and click on This PC or My Computer. Double-click on C:, then the Windows folder and scroll down the page until you reach the System32 folder. Inside of that folder, open drivers and then open etc. You’ll now see several files, one of which is hosts.

If you want to open a file type like the hosts file, you will need to use a program like Windows Explorer.

To edit the hosts file in Notepad, follow these steps:

  1. Click the OK button to open Notepad.
  2. Select Notepad from the list of programs that appears on your computer’s desktop.
  3. Click the OK button to open the hosts file information.
  4. Edit the hosts file as you see fit and click the OK button to save your changes. ..

Windows 10: How to Open the Hosts File Windows 10 users can open the hosts file by following these steps:

  1. Open the Start menu and search for “Notepad.”
  2. When Notepad is found, right-click on it and select “Run as Administrator.”
  3. When Notepad opens as an Administrator, click on the “File” menu and select “Open.”
  4. In the Open dialog box, navigate to C:\Windows\System32\drivers\etc.
  5. Double-click on the hosts file to open it. ..

Notepad will now open with administrative privileges. ..

Open the hosts file in Notepad. Navigate to C:\Windows\System32\drivers\etc and you will get a blank screen that displays the prompt No items match your search. Change Text Documents (*.txt) to All Files using the drop down menu. Now, you can select the hosts file and click Open.

127.0.0.1 localhost This file is used to identify the local computer on which a particular application is running. You can add any number of files to this file, including your own applications and website’s files.

Block Websites using HOSTS File

127.0.0.1 www. blocked This will block all websites on your computer from being accessed.

Blocking website: www.nytimes.com

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

This prank can be used in a few different ways. For example, you could redirect the website to another website if you don’t want it to block on your device. You could also prank your parents by blocking the website on their device.

netstat -an | grep tcp This will show you all the active TCP connections on your computer.

In my example, I pinged Adobe.com. The IP address is 192.150.16.117 and now I can simply plug that number into my hosts file in front of www.nytimes.com

When I visit www.nytimes.com, I get redirected to Adobe.com! This is great! Note that if this doesn’t work for the websites you are entering, it could be because of the URL you are using. For example, it makes a difference if you use www.nytimes.com as opposed to nytimes.com without the www. Visit the website and see exactly what the URL is for the website you want to redirect. You should always try without the www first to see if that works

If a website uses HTTPS, it should still redirect if the user types the host name (i.e. google.com). There is no way to specify the HTTPS version of a website in the HOSTS file, but it should redirect the HTTPS and non-HTTPS versions of the website if you use just the host name (i.e. google.com). ..

192.168.1.3 myrouter.com

If you are having trouble accessing your router, it may be because the hosts file is not being read. You can try using different browsers or devices, but if that doesn’t work, you may need to check the IP address of your router. I tested it on all of the devices and it worked.

Windows 10 still has the hosts file. It is useful and works just fine in Windows 8, 7, Vista, etc. If you have any questions, feel free to comment. Enjoy! ..