Have you completed the cPanel migration? How to preview the website before DNS Propagation in cPanel? You can use the cPanel site preview option. Follow the steps given below.
The first step is to get your domain user name/account ID. You can find it on the right side of your cPanel. If you are using WHM, you can go to Home>> Account Informations >> List Accounts, and here you can find the account ID/Name. If you prefer the command line way, please follow the below steps.
Assume your system IP is 2xx.xxx.xxx.xxx. The domain name is “example.com”, and the account name is “exam”.
1) Login to your server using SSH.
2) Run the below command.
grep example.com /etc/trueuserdomains | awk ‘{printf $2}’ exam
There you go! You got the account name.
cPanel has the “mod_userdir” installed by default. So, to preview the site, all you have to do is open your browser and type the following.
http://your_cPanel_IP/~account_name
In this case, it will be as follows.
http://2xx.xxx.xxx.xxx/~exam
Note: In some cases, if the domain is set to use a base URL, it may redirect to the original domain. So, in that case, this method is not preferred. You can use the “host” file method to preview the site. You can find a tutorial regarding that here.