The hosts file is a local file on your computer that maps domain names to IP addresses. Editing it lets you preview a website on a new server before going live with the site on the new server.

Step 1: Open Notepad as Administrator
The hosts file requires administrator privileges to edit.

    1. Press the Windows key, then type Notepad
    2. Right-click Notepad in the search results
    3. Select “Run as administrator”
    4. Click Yes if prompted by User Account Control (UAC)

Step 2: Open the Hosts File

    1. In Notepad, go to File ? Open
    2. Navigate to the following path:
           C:\Windows\System32\drivers\etc
    3. In the file type dropdown (bottom right), change it from “Text Documents (*.txt)” to “All Files (.)”
    4. Select the file named hosts and click Open

Step 3: Add Your Entry

    1. Scroll to the bottom of the file. Add a new line in this format:
           000.000.000.000 yourdomain.com
    2. Replace 000.000.000.000 with the IP address you were given, and yourdomain.com with the actual domain.
      Example:
           192.168.1.100 example.com
           192.168.1.100 www.example.comMake sure there is at least one space or tab between the IP address and the domain name.

Step 4: Save the File

    1. Go to File ? Save (not “Save As”). The file has no extension, so saving directly is important.

Step 5: Flush Your DNS Cache
To make sure Windows picks up the change immediately:

    1. Press Windows key + R, type cmd, and press Enter
    2. In the Command Prompt, type:ipconfig /flushdns
    3. Press Enter. You should see a confirmation message.

Step 6: Verify It’s Working
Open your browser and navigate to the domain. You should now be seeing the site from the IP address you specified.