How can I check the content of my website before switching the DNS records?

0

If you are transferring the website to our hosting, or have not changed the DNS records for your domain yet, but you would like to check how your web-site will look like on our servers. It is all possible. You can find two ways of setting it below:

1) Modifying ‘hosts’ file

– Windows OS
– Mac OS

2) Creating a subdomain

1) Modifying ‘hosts’ file

This method allows you to check your site’s look by simply typing its name in the browser. When the file is modified, this doesn’t influence your domain’s DNS zone and all the users on the web continue to see the site from your old server. You, however, will not need to wait for the DNS propagation and all the changes will be instantly applied.
To set the file up, please perform the following steps:

If you use: Windows OS
– It is recommended to close the browser before performing the change;
– Please open the folder C:\Windows\System32\drivers\etc;
– Double-click on the ‘hosts’ file and choose the Notepad from the list of available software;

hosts1

Input the following string in the end of the document:

IP_address domain_name

(IP_address is the IP address of your account on the server, and domain_name is your domain name)

NOTE: you should also add second record below the first one, in case your website is set to redirect to www. :

IP_address www.domain_name

– Save the file and re-open your domain name in the browser.

If you are using Mac OS:
– Open the Terminal.app, either by start typing Terminal on the Spotlight, or by going into Applications –> Utilities –> Terminal;
– Open the hosts by typing on the Terminal that you have just opened:
sudo nano /private/etc/hosts

hosts3

Type your user password when prompted;
*You can navigate the file using the arrow keys;

Edit the hosts file appending your new mappings underneath the default ones:

IP_address domain_name

(IP_address is the IP address of your account on the server, and domain_name is your domain name)

NOTE: you should also add second record below the first one, in case your website is set to redirect to www. :

IP_address www.domain_name

hosts4

– Save the hosts file (when done editing the hosts file, press CTRL+o to save the file. Press Enter on the filename prompt, and Ctrl+x to exit the editor. );
– Flush the DNS cache ( you can issue a simple Terminal command to flush the DNS cache, and have your host file changes to take immediate effect: dscacheutil -flushcache ).

 2) Creating a subdomain

Another way to check your web-site without changing DNS records is creating a subdomain in your current hosting account. To do this you should:

1. Create a subdomain for your domain in our server cPanel ->Subdomains->“Create a Subdomain” (test.example.com for instance)
Please note, that you can point your subdomain to public_html directory and it will show all content from your public_html folder

hosts5

2. Create the same subdomain (test.example.com ) in your active DNS zone for your domain and point it to our server’s IP address.
And now after about 30 minutes ( this is how long it takes for this records to propagate ), you can open this subdomain in your browser or using proxy services ( for instance this one ).

This is it!

Need any help? Contact us via HelpDesk

About Author

Leave a Reply

Your email address will not be published. Required fields are marked *