1. Click on Start and in search enter cmd.
2. You will see the Command Prompt option.
3. Right click and select Run as Administrator.
4. Click on Yes.
5. In the command prompt window; type the following.
6. You will see the following in the command prompt.
7. Enter the following.
8. Scroll to the bottom of the file and based on the SharePoint variant yuou have enter the relevant details. Here are the relevant details
For SharePoint Foundation:
18.104.22.168 <<sharepoint site URL>>>
For example: If your SharePoint site URL is sharepoint.contoso.com then the entry on hostfile would look like this.
For SharePoint Standard and Enterprise:
22.214.171.124 <<sharepoint site URL>>
For example: If your sharepoint site URL is sharepoint.contoso.com then the entry on hostfile would look like this.
For Project Server Instance:
126.96.36.199 <<Project Server site URL>>
For example: If your Project Server site URL is pm.contoso.com then the entry on hostfile would look like this.
NOTE: If you are still unable to access the site then it means that your proxy server or your ISP overrides your systems host file settings and you will have to wait for the DNS to propagate and then you could try accessing the site.