Ablion-blog

To test your website before DNS propagation is through you can edit the HOSTS file on your local computer. Your computer will use the entries in your HOSTS file before it looks up the current information in DNS. This walkthrough will explain how to edit the HOSTS file on Windows 98/Me/2000/XP/2003 computers as well as on Apple Mac OS9 and OSX machines.

Windows:

Step 1 : – Locate the HOSTS file on your computer. Depending on the operating system you have, the following are locations you may be able to find this.
for Windows NT/2000/XP/2003/2008 _ C:\WINDOWS\System32\drivers\etc\hosts & for
Windows 95/98/Me _ c:\windows\hosts

 

Step 2 :- Open this file with notepad or wordpad. In it near the end you will see two columns of information, the first containing IP addresses and the second containing host names.The only one in a windows hosts file by default looks like this :

127.0.0.1 localhost

We are going to add lines just underneath the existing line that will point request from your computer to your new server’s IP address. Suppose the IP address of your new server is 10.10.10.53 and the domain name you want to test is www.my-domain.com, you’d make a two line entry like this:

10.10.10.53 my-domain.com

10.10.10.53 www.my-domain.com

Step 3 :- Save the file with these new entries and close all open browsers. You can now go to either http://www.my-domain.com or http://my-domain.com to test your new server.

Step 4 :- When finished testing your new server don’t forget to reopen the HOSTS file to remove the lines you added above.

 

Mac OS9:

Step 1 :- Look in System Folder:Preferences, and in the System Folder itself. See if you have a file named “Hosts”. If not, create one in a text editor.

Step 2 :- Open this file with any text editor. In it near the end you will see two columns of information, the first containing IP addresses and the second containing host names. There might be an existing line that looks like this:

127.0.0.1 localhost

We are going to add lines just underneath that line that will point request from your computer to your new server’s IP address. Suppose the IP address of your new server is 64.207.100.100 and the domain name you want to test is www.my-domain.com, you’d make a two line entry like this:

64.207.100.100 my-domain.com

64.207.100.100 www.my-domain.com

Step 3 :- Save the file with these new entries and close all open browsers. You can now go to either http://www.my-domain.com or http://my-domain.com to test your new server.

Step 4 :- When finished testing your new server don’t forget to reopen the HOSTS file to remove the lines you added above.

 

Mac OSX :

Step 1 :- To edit the hosts file on Mac OSX open a Terminal window by going to Applications -> Utilities A window will appear that has something like:

Last login: Thu Sep 3 , 11:46:46 on ttyp1

Welcome to Darwin!

520bro057036b:~ user-name$

 

Step 2 :-

At the prompt type (or cut and paste):

sudo echo “xxx.xxx.xxx.xxx domain-name.com” >> /etc/hosts

 

where xxx.xxx.xxx.xxx is replaced with the IP of your server and domain-name.com is replaced with the domain name you’d like to test. Hit “Enter”.

 

Step 3 :-

Enter the password for your computer if the prompt asks for it and hit “Enter”.

 

Step 4 :-

Your hosts file has been edited, to make sure the changes have applied close all open browser windows (Safari, Mozilla, Internet Explorer).

 

Step 5 :-

When finished testing please don’t forget to remove the line you added to the hosts file by opening a terminal and typing (or cutting and pasting):

cd /etc/

perl -e ‘open(F, “hosts”); @array = (); close(F); open(FH, “> hosts”);print FH @array[0..($#array – 1)]; close(FH);’

Hit enter after each line, this will remove the last line in your HOSTS file. If you added more than one entry you’ll have to repeat the last command the corresponding number of times.

 

On Ubuntu Linux

use the commend sudo -i gedit /etc/hosts

and add these to the hosts file

64.207.100.100 my-domain.com

64.207.100.100 www.my-domain.com

Notes :

Ablion” does not support this configuration. We are providing this information to you as a courtesy. We are not Microsoft Support Technicians so you need to use this work around at your own risk.

***Always always always back up your files !

 

Tags: ,