How To Use Etc Hosts File
Add the following line to the etc hosts file.
How to use etc hosts file. Follow the screenshot for better understanding. In notepad click file then open. To do this just enter in the following after the mark. Select text documents txt in the bottom right of the open window and change it to all files. Now that you have edited your hosts file make sure to save it.
Go to the real hosts file location and rename it. Once notepad is open you can edit the file. Now open the etc hosts file using your editor of choice as follows sudo vi etc hosts then add the lines below to the end of the file as shown in the screen shot below. Now notice if we try to access facebook in ie we can t get to the page. Open notepad or another text editor like notepad.
To view files in etc folder use the down arrow to switch to all files view. 2 after that in the command prompt window type the below commands one after another to go to the hosts file directory and open the hosts file in the notepad program. 1 on the windows 10 computer right click on the start menu and select command prompt admin. From a workstation that has access to your storage system edit the etc hosts file. In the text editor select file open and open the host file location at c windows system32 drivers etc.
Once the files are visible select hosts file and click on the open button. Configure dns locally using etc hosts file in linux. Ip address host name aliases ip address is the ip address of the host. To access the hosts file in windows 7 you can use the following command in the run line to open notepad and the file. One way to do that is to search for the word notepad in windows 10 right click or tap and hold the notepad search result and.
Alternatively you can navigate to c windows system32 drivers etc using the left pane menu. Edit using the correct format and save the hosts file with windows notepad. Host name is the name of the host. In the file name field paste the following path in. In open file dialogue box type c windows system32 drivers etc as the file name entry.