Question
How can I view my site without pointing DNS?
Answer
As long as your domain isn't pointing to an IPv6 address, such as with CloudFlare, it is relatively easy to see how your site is going to look once it's pointed. To accomplish this, modify your local computer's hosts file.
We have a complete guide at How to Modify Your Hosts File.
The basic gist is that you want to add a line in the file containing your website's IP address, and the domain and any subdomains that it uses. Here's an example:
1.2.3.4 domain.tld www.domain.tld subdomain.domain.tld addon.tld
After adding this line to your hosts file and saving it, all you need to do is load your website in the browser.
You might also consider reviewing the curl method if you just need to test some simple things on your website:
How to use curl to diagnose site issues on an IP that does not match the current A record
How About Servers with Multiple IP Addresses? If there is more than one IP address bound to the server, then which one I need to include in the host file?
You need to point the domain to the IP address for the account. The correct IP might not necessarily be the main IP address of the server. On a cPanel server, you can find out which IP address a domain uses by running the following command:
egrep -i "^foo.bar.com" /etc/userdatadomains | awk -F "==" '{ print $6 }' | awk -F ":" '{ print $1 }'
Alternatively, open the file /etc/userdatadomains with a text editor such as "less" and find the domain's line. The IP returned from that command is the IP address that Apache uses for the domain.
The returned domain might be the one that you need to use in the host file to visit the domain foo.bar.com via your browser. Otherwise, if the returned IP address is internal*, you will need to check for the NAT configured public IP address.
You can easily check the NAT table by running the following command to ensure that you have the latest information:
/usr/local/cpanel/scripts/build_cpnat
You can also just check the cpnat file:
cat /usr/local/cpanel/cpnat