Here, we explain how to create a hosts file modification on your device. Modifying the hosts file will allow you to view the site on the InMotion Hosting server without pointing DNS to the server. This means you can preview what your site will look like after the DNS is updated without visitors seeing the site on the new hosting.
In order for this to be useful, the domain will need to be added to the cPanel, and any site files will need to be uploaded to the server. Then, using a hosts file modification on the local PC, you can view the site as it would appear on the InMotion Hosting server without modifying DNS records.
Only the device with the hosts file modification will see the site on the InMotion Hosting server. All other devices will still be viewing the site on the server, as determined by DNS records.
Via Windows
IMPORTANT: The website files will need to be uploaded to the server so that the website can be viewed. If you haven't migrated the website, please submit a Submit Website Transfer Request or make sure that site files have been uploaded via FTP client or File Manager to the proper document root.
- Run Notepad as an administrator
- Search for Notepad in the start menu
- Right-click the Notepad application
- Select Run as administrator
- Search for Notepad in the start menu
- In Notepad, open the file named hosts
- Navigate to File>Open...
- Navigate to the hosts file location
TIP: This file is typically found in c:\windows\system32\drivers\etc, but some other locations are listed below.- Windows 95/98/Me: c:\windows
- Windows NT/2000/XP Pro: c:\winnt\system32\drivers\etc
- Windows XP Home/Vista/Windows 7: c:\windows\system32\drivers\etc
- Windows 8, Windows 10, Windows 11: c:\windows\system32\drivers\etc
- In the lower right-hand corner dropdown, select All Files (*.*)
- Select the hosts file that is now visible
- Select Open
- Navigate to File>Open...
- Add the server IP address and domain names to the bottom of the hosts file
12.34.56.78 domain.com www.domain.com
REPLACE: Use the actual server IP address in place of 12.34.56.78 and use the actual domain name instead of domain.com and www.domain.com.
TIP: This can also be used to check subdomains! - Navigate to File>Save to save the file
NOTE: When loading the site in the browser, you will now load it from the server IP address.
IMPORTANT: If your site is cached, you may need to clear your browser cache first.
CAUTION: Once you're done reviewing the site using the hosts file, please ensure you delete the custom entry from your hosts file. If it's left in place, you'll continue to load the site from the custom IP, even if you later need to update the DNS again.
Via Mac
IMPORTANT: The website files will need to be uploaded to the server in order for the website to be viewed. If you haven't migrated the website, please submit a Submit Website Transfer Request or make sure that site files have been uploaded via FTP client or File Manager to the proper document root.
- Open the terminal (Applications>Utilities>Terminal)
- Open the hosts file by typing
sudo nano /etc/hosts
NOTE: On older Macs, you may need to usesudo nano /private/etc/hosts
instead. - Enter the server IP address and domain names to the bottom
12.34.56.78 domain.com www.domain.com
REPLACE: Use the actual server IP address in place of 12.34.56.78 and use the actual domain name instead of domain.com and www.domain.com.
TIP: This can also be used to check subdomains! - Save the file with <Ctrl+O> followed by <Enter> to accept the change
- Exit nano with <Ctrl+X>
NOTE: When loading the site in the browser, you will now load it from the server IP address.
IMPORTANT: If your site is cached, you may need to clear your browser cache first.
CAUTION: Once you're done reviewing the site using the hosts file, please ensure you delete the custom entry from your hosts file. If it's left in place, you'll continue to load the site from the custom IP, even if you later need to update the DNS again.
Comments
0 comments
Article is closed for comments.