Modify your Hosts File

Modifying your hosts file enables you to override the domain name system (DNS) for a domain on a specific machine.

DNS management is useful when you want to test your site without the test link prior to going live with SSL, verify that an alias site works prior to DNS changes, and for other DNS-related reasons.

For information about changing your DNS settings.

Modifying your hosts file causes your local machine to look directly at the Internet Protocol (IP) address that you specify.

Modifying the hosts file involves adding two entries to it.

Each entry contains the IP address to which you want the site to resolve and a version of the Internet address.

For example, add the following two entries points, www.domain.com and domain.com.

This article provides instructions for locating and editing the hosts file on the following operating systems:

After you add the domain information and save the file, your system begins to resolve to the IP address that you specified. When testing is complete, remove these entries.

If you are using a Microsoft operating system like Windows 10, Windows 8, Windows 7, and Windows Vista you must run Microsoft Notepad as an administrator.

Windows 10 and Windows 8
Use the following instructions if you’re running Windows 10 or Windows 8:

  •  Press the Windows key.
  • Type Notepad in the search field.
  •  In the search results, right-click Notepad and select Run as Administrator.
  •  From Notepad, open the following file:
  •  c:\Windows\System32\Drivers\etc\hosts
  •  Make the necessary changes to the file.
  •  Select File > Save to save your changes.

Source: Modify your Hosts File