Some times we need to test websites before switching to new name servers or some times after updating domain’s name server settings, DNS propagation may take from 24 to 48 hours to complete. During this time, we cannot use your domain name. However, we can bypass DNS and view the web site by using the hosts file.
Here is the steps to use hosts file to bypass DNS for your domain:
Step 1: Open the hosts file in a text editor. The location of the hosts file depends on various operating system
hosts file locations:
Microsoft Windows computers – %SystemRoot%\system32\drivers\etc\hosts.
Apple Macintosh computers – /private/etc/hosts
Linux computers – /etc/hosts
Step 2: Add the following line to the file
192.168.1.1 example.com www.example.com
Note: Replace the IP address with your website IP address, and replace example.com with your web site’s domain name.
Step 3: Save the hosts file and exit the text editor.
Step 4: Now the website start resolving from the server in which the IP address that you configured on hosts file has.