Modifying hosts file

Customizing the HOSTS file All it takes is a simple text editor such as Notepad (Start, All Programs, Accessories) to add website addresses to the HOSTS file. Make a backup of the C:WINDOWSSYSTEM32DRIVERSETCHOSTS file (note: the name of the HOSTS file does not have an extension) before making any changes to it. After the file has been copied to a safe location, the original file can be opened and edited (just right-click the Notepad shortcut and choose Run as administrator). A standard HOSTS file looks something like this (lines starting with a # sign are irrelevant, they only contain comments): # localhost: Needs to stay like this to work 127.0.0.1 localhost Referring a website as a test. This setting allows us to override the default DNS data and ensure that the website you type in points to the new location. # localhost: Needs to stay like this to work 127.0.0.1 localhost 83.98.155.74 voorbeeld.nl 83.98.155.74 www.voorbeeld.nl You can now save the file and if you open a new browser you will see the website in the new location. If you want to open the website in a browser that is already open, it may be cached, use the keyboard combination ( ctrl + F5 ). Block a website A website can be blocked by adding a line to the HOSTS file for the associated website address that references the IP address 127.0.0.1 (your computer’s own computer). In the example below, the website is www.google.nl blocked. The blocking of this website is of course not desirable in practice, but the example clearly shows the consequences of including a website address in the HOSTS file. #localhost: Needs to stay like this to work 127.0.0.1 www.google.nl

Leave a Reply

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