How can I test or preview my website before switching DNS?
If you have recently registered a new domain or updated the DNS of your existing domain name at your current registrar, it can take anywhere from 24 to 72 hours for the domain name servers to fully propagate across the web. Rather than wait for the propagation process, you can test or preview your website on our servers before DNS propagation using various different methods.
cPanel servers usually allow checking your website using a temporary URL (http://126.96.36.199/~username/) however due to mod_userdir module being insecure, it can leave your website vulnerable to malicious attacks. Because of this, mod_userdir and temporary URLs are disabled on our shared & reseller hosting servers.
Modifying computer's HOSTS file
The best method of testing or previewing your website is by modifying your computer's local HOSTS file. The hosts file is a computer file used by an operating system to map hostnames to IP addresses. The hosts file is a plain text file, and is conventionally named hosts.
- Locate Notepad from your Start menu search.
- For Windows 7 and earlier, click Start >Accessories. For Windows 8 and 10, type Notepad from the Start screen.
NOTE: You will have to use Notepad with administrative privileges in order to be able to modify the HOSTS file (right click Notepad -> Run as Administrator).
In the HOSTS File you will see two columns, one containing the IP address and the second containing host name. You can add additional lines to the HOSTS file which will point your requests for that particular domain to your new server IP.
188.8.131.526 domain.com www.domain.com
(Replace "184.108.40.2066" with your server IP and domain.com with your actual domain name)
MAC OS X
- Open Terminal by going into Applications > Utilities > Terminal
- open the HOSTS file by typing the following in the Terminal app:
sudo nano /private/etc/hosts
- Input your USER password at the prompt
- Your Hosts file will look something like this
## # Host Database # # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost
- Add your domain and IP address to the bottom of the file.
- Save the hosts file (press CTRL+O to save the HOSTS file > press Enter on the filename prompt > Ctrl+X to exit editor).