Hosts File

From Lunarpages Web Hosting Wiki

What is the hosts file and how should I use it?

Using the Hosts file to point your domain to an IP to resolve the domain to that IP for that machine only. Can be used to speed up the resolving of a domain or testing your site on a server before changing nameservers to point to it.

You can set your hosts file to point the domain to the server IP

You would just add the following to the file on your PC and save it:

(You may need to alter the permissions for the file, right click on the hosts file choose properties and if read only is checked un-check it)

Location of this file is:

Windows 95/98/ME

  • Location = x:\Windows\hosts

Windows 2000

  • Location = x:\WINNT\System32\Drivers\etc\hosts

Windows XP/Vista/7/8

  • Location = x:\Windows\System32\Drivers\etc\hosts


  • Location = /etc/hosts

Mac OS

  • Location = /etc/hosts