To edit hosts file in Windows 10, you need to run Notepad as Administrator. To do that, using your windows search icon in the taskbar in windows 10, in windows 7, click start / and type in search box: notepad.
Sometime, you’d want to use the Hosts file instead of just letting DNS do its thing. For example, you are testing your sites before public it. Or you want to move site from old hosting to new hosting but dont