Hosts File

From Lunarpages Web Hosting Wiki
Jump to: navigation, search

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 xxx.xxx.xxx.xxx

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

xxx.xxx.xxx.xxx domainname.com
xxx.xxx.xxx.xxx www.domainname.com

(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

Linux

  • Location = /etc/hosts

Mac OS

  • Location = /etc/hosts
Share |
Want to read this in another language?