For example, if you’re moving a website to a new host provider, and you need to move the files to the new server before switching the domain to the new Internet Protocol (IP) address. You want to block certain websites from being accessed using your computer. Or when you don’t have a local Domain Name System (DNS) server configured in the network, and you need to map an IP address to a computer name so you can contact the device using its name. Whatever the reason it might be, it’s very simple to edit the hosts file on Windows 10 using the Notepad app. In this guide, you’ll learn the steps to modify the hosts files on Windows 10 to map host names to IP addresses.

Edit ‘hosts’ file using Notepad

To edit the hosts file on Windows 10, use these steps: Once you complete the steps, you can test the changes by opening Command Prompt and using the ping command (for example, ping to make sure the host is being reached. Hosts file location on Windows 10 Hosts file on Windows 10 If you want to block your computer from accessing certain websites, you can use the loopback address ( followed by the domain name (for example, — though, using the built-in Windows Firewall or a third-party security software can be more suitable for the job. We’re focusing this guide on Windows 10, but you can use these instructions on Windows 8.1 and Windows 7. Update August 11, 2020: This guide was originally published in August 2017, and it’s been revised in August 2020. All content on this site is provided with no warranties, express or implied. Use any information at your own risk. Always backup of your device and files before making any changes. Privacy policy info.