Preview your website before switching over DNS
Edit hosts file in Windows Operating System.
Below is the procedure for the windows operating system, where can edit hosts file in the system.
Step 1.
In the Windows menu, type Notepad. Right-click on the icon and select the Run as administrator option.

Step 2.
Open the hosts file from the file menu in the notepad (CTRL+O).
The location of the file is:-
C:\Windows\System32\drivers\etc\hosts.
If you couldn’t locate the file, then change ‘Text Documents’ to ‘All Files’ in the notepad. Now, you can access all the files, including the hosts file.

Step 3.
Next, you need to add the following text in the same format at the end of the file.
Your hosting IP Domain name
For example,
1.1.1.1 example.com
1.1.1.1 www.example.com
1.1.1.1 example.com/wp-admin

Step 4.
Save the file (CTRL+S). (Don’t use the save as option, use save option only)
Step 5.
Close any browser tab if open and restart the browser. Type your website name and this will load your website from the server.
Below is the procedure for the windows operating system, where can edit hosts file in the system.
Step 1.
In the Windows menu, type Notepad. Right-click on the icon and select the Run as administrator option.

Step 2.
Open the hosts file from the file menu in the notepad (CTRL+O).
The location of the file is:-
C:\Windows\System32\drivers\etc\hosts.
If you couldn’t locate the file, then change ‘Text Documents’ to ‘All Files’ in the notepad. Now, you can access all the files, including the hosts file.

Step 3.
Next, you need to add the following text in the same format at the end of the file.
Your hosting IP Domain name
For example,
1.1.1.1 example.com
1.1.1.1 www.example.com
1.1.1.1 example.com/wp-admin

Step 4.
Save the file (CTRL+S). (Don’t use the save as option, use save option only)
Step 5.
Close any browser tab if open and restart the browser. Type your website name and this will load your website from the server.
Updated on: 07/12/2023
Thank you!