How to preview a website without changing DNS?
Leave a comment on How to preview a website without changing DNS?
If you are looking for cPanel web hosting that is affordable, with expert support you can count on 24×7, be sure to take a look at RackNerd’s Shared Hosting offers!
In this tutorial we are going to go over how to preview a website without actually updating the nameservers on the domain itself.
Every time you make the DNS changes, it will take up to 48-78 hours for complete propagation. To check whether the website on the newly deployed server is working or not, in that case, you might need some way to preview the website without changing DNS. That’s when this article will help you! This article has elaborated on different ways to preview a website without even changing the DNS! How? It can be achieved by locally resolving the server’s IP address in the hosts file.
Windows
For the Windows operating system, you have the hosts file stored at the following locations,
- Windows NT, 2000, XP, 2003, Vista, 7, 10, 11 – C:\windows\system32\drivers\etc\hosts.
- Windows 95, 98, Me – C:\windows\hosts.
Right-click on the hosts file → Open with favorite text editor as a administrator. For this article, we will be using NotePad++.
For temporary resolving the IP address to a specific domain name has a default template to follow,
127.0.0.1 racknerddemo.com
127.1.1.1 racknerdseconddemo.com
In the place of 127.0.0.1/127.1.1.1 IPs, enter the server IP addresses and replace the racknerddemo.com/racknerdseconddemo.com domain with the actual domain names.
Finally, save the file to make the changes.
Now you should browse the website from the manually configured server IP address. Please note that we highly recommend re-opening the browser to avoid cache conflict if you have already opened browser windows.
Just remove the added lines from the C:\windows\system32\drivers\etc\hosts file to revert the changes.
Linux/macOS
Like the windows systems, you are most likely to perform the same steps, except the file location for the hosts file is different here: /etc/hosts.
Using any of the file editor in linux open /etc/hosts file, for this article we will be using “vi” editor,
vi /etc/hosts
Press “I” to enter into editor mode and add the following lines (as shown below),
127.0.0.1 racknerddemo.com
127.1.1.1 racknerdseconddemo.com
In the place of 127.0.0.1/127.1.1.1 IPs, enter the server IP addresses and replace the racknerddemo.com/racknerdseconddemo.com domain with the actual domain names.
Press Esc → Type “:wq!” to save and exit from the file.
Now you should browse the website from the manually configured server IP address. Please note that we highly recommend re-opening the browser to avoid cache conflict if you have already opened browser windows.
Just remove the added lines from the /etc/hosts file to revert the changes.
Using SkipDNS
SkipDNS is one of the best tools to browse the website without even pointing the domain to the server. Practically, it works with the proxying principle.
We are using the following details and click on Create ,
IP: 104.26.9.13
Live URL: racknerd.com
You must need to agree the TOS of SkipDNS → Click on Yes. Proceed with the proxy.
Next, SkipDNS will generate a short SkipDNS URL (as shown in the above image) which will interact with the provided IP addresses (in our that is 104.26.9.13), passing hostname racknerd.com as the identifier. Upon agreeing to the TOS, you will be able to browse the racknerd.com domain through the 104.26.9.13 Ip address on fhap9.skipdns.link.
We hope that you found this tutorial helpful! If you are looking for a new & reliable hosting provider, be sure to take a look at RackNerd.