To test your web site using your own domain name BEFORE DNS propagation has completed, you can use your local computer’s HOSTS file. Your computer will use the entries in your HOSTS file FIRST before it tries to use your IPS to look up the DNS information for your domain.
REMEMBER: When you are finished testing, remember to remove the custom lines that you added to your Hosts file.
3> Below is the steps to edit hosts file on your PC.
- Launch NotePad
Click on your Windows icon in the Task Bar in the bottom left hand corner of your screen.
In the “search” field, type “Notepad”. A list of entries will appear.
IMPORTANT (Windows 7 and later): Right-click on Notepad choice found and select “Run as Administrator “. If you don’t have the run as Administrator option it means you don’t have these privileges. Contact your IT person to get them or to set up the local host for you. - Open your local HOST file
Within Notepad go to File Menu->Open and locate the HOSTS file on your computer.IMPORTANT: In the bottom right hand corner of the Open dialog box, change the popupmenu FROM “Text Documents (*.txt)” TO “All Files”
Typically it is in one of the following locations:- Windows NT/2000/XP/2003/Vista/7/8/10 – C:windows/system32/drivers/etc/hosts
- Windows 95/98/Me – C:windowshosts
- Consider performing a “Save As” so you have an original copy of the file that you can restore later.
- Filename: hosts
-
You can add additional lines to this file that will point requests for a particular domain to your new server’s IP address.
-
Example:
Filename: hosts
127.0.0.1 localhost
66.186.19.2 www.suetest.comEdit to local HOST File
You will see two columns of information, the first containing IP addresses and the second containing host names. By default, a windows hosts file should be similar to the following:
-
- Save your changes
IMPORTANT: be sure to save as a host file, NOT as a text (.txt) file
Windows wants to save it as text (.txt) so you need to- Change “save as” type to “all files”, and then
- Click on “host” (the original file).
- Restart any currently open browsers
- Flush your DNS Cache
You may also want to flush your DNS cache. In Windows, go to Start/Windows button in the bottom left of your Task Bar, and in the search field type “cmd” and hit the Enter key on your keyboard.
Type the following: ipconfig /flushdns - Test your changes
In your web browser you should see your site as it appears on your testing server when typing http://www.suetest.com/ but still be able to see the site on its current web server by visiting http://www.suetest.com/