From your command line terminal type the following command: sudo nano /etc/hosts.This takes you back to the terminal screen. Save your changes by pressing control-o on your keyboard then return to accept the filename.Edit the hosts file using the following format:.Type in your user password when prompted.In the Terminal you just opened type the following command: sudo nano /private/etc/hosts.Open the Terminal app by using either the Spotlight search or by navigating to Applications=>Utilities=>click Terminal.Your domain(s) will now be manually pointed to the IPs listed in the host file. Once you have added your hosts entries save the hosts file.In the above example replace 1.2.3.4 with the IP address you want to point your site to and replace with the domain name you're working with.Once you're viewing the host file add the entries one per line as needed.If you don’t see the hosts file in the C:\Windows\System32\drivers\etc\hosts directory then select All files from the File name: drop-down list, then click on the hosts file. Navigate to C:\Windows\System32\drivers\etc\hosts or click the address bar at the top and paste in the path and choose Enter.In your notepad click File and then Open.You’ll be asked “Do you want to allow this app to make changes to your device? ”.Right click on notepad and click Run as Administrator.Click the Windows button and type notepad to bring up the notepad utility.
#Hosts file location windows 10#
Windows 10 – “C:\Windows\System32\drivers\etc\hosts”.The hosts file is located in the following locations depending on your system: on 17 December 2020 12:41 PMĮditing your local systems hosts file allows you to manually point a website to a specific IP instead of relying on public DNS resolution.