Modify the Hosts File to View New Domains on a Dedicated Server

Plesk Servers > DNS

Modify the Hosts File to View New Domains on a Dedicated Server


If you have just set up a new domain on your server and have not yet pointed your DNS to the new location, but are unable to view the new domain, or it goes to the old location you can use the steps below to modify your Hosts file to tell the server to look at the local IP address to load the site.  There are two possible ways to do this.
  • Using the Control Suite 
  • Manually Changing the Host File

Method One: Using the Control Suite

  1. Log on to your server using Remote Desktop.
  2. Open the Control Suite from the desktop. If the shortcut is not available, browse to c:\netstrap\SystemControl and run NetStrap.exe via Windows Explorer.
  3. Expand your Plesk node in the Navigation Tree.
  4. Expand the domain name you wish to manage.
  5. In the Commands Ribbon click the Override DNS tile.
     

    •  
  6. Once the Host file has been modified you will receive a "DNS has been overridden" confirmation in the Output Pane.

Method Two: Manually Changing the Host File

Altering any system file can cause issue with stability and possible server crash. Be sure to back up the file before altering it so you have a fallback point.

You will need to first know the IP address of the new domain. If you're unsure of what the IP address is you can find it in the Control Suite using the steps below:

  1. Log on to your server using Remote Desktop.
  2. Open the Control Suite from your Desktop.
  3. Expand your Plesk node in the Navigation Tree.
  4. Click on the domain you need to find the IP address for.
  5. The IP address will be listed in the Info Pane.

Once you have found and noted the IP address of the domain continue with the steps below:

  1. Click on Start > Run. (2003-2008) or Windows+R (2012)
  2. In the Run dialog box type c:\windows\system32\drivers\etc\hosts and press Enter.
  3. The Hosts file should automatically open in Notepad, but if you are prompted to choose how to open it, select Notepad.
  4. Scroll to the bottom of the file and add the following information, replacing [IP ADDRESS] with the IP you found in the steps above, and Domain.com with your new domain name.
    [IP ADDRESS] Domain.com
    [IP ADDRESS] www.Domain.com
    [IP ADDRESS] mssql.Domain.com
    [IP ADDRESS] webmail.Domain.com
  5. If you have set up a temporary URL or other domain aliases for the domain repeat the last step for each of them.
  6. Save the file and close it.

After completing either of the two options above, you will need to refresh your browser and the sites will then become viewable on the server.  This will not make the site viewable off the server, and you will still need to point the DNS of the domain to either your Custom NameServers, which can be created by following the instructions in our How to Make Custom Nameservers article, or the IP of the domain on the server through your domain registrar's Control Panel.

 

Add Feedback