Add hosts to a local host file

There may be some cases where you need to test a newly created website but your domain name is not yet pointing to your new hosting servers. To achieve this you need to locate and edit your hosts file , entering in the ip address of your new website and the domain name(s) you wish to resolve too the IP . Examples are given below.

Windows

Open windows explorer and browse to C:/Windows/System32/drivers/etc and open the hosts file with notepad. Scroll down to the end of the file and enter in your websites ip address followed by the domain name you wish to resolve e.g

192.168.1.2 www.newdomain.comĀ newdomain.com

Save and close this file.

When you open the domain www.newdomain.com in your favourite internet browser it will resolve to your new ip 192.168.1.2

Mac OS

Edit the /private/etc/hosts file. Further information on how to use the hosts file can be viewed by opening Terminal and typing: man hosts

Please Note: Editing this file requires root privileges.

  • 176 Users Found This Useful
Was this answer helpful?

Related Articles

What is web hosting

Visit this mini site to learn more about web hosting http://www.whatiswebhosting.ie

Glossary

APACHE Apache is an open source Web server that is distributed free. Apacheruns on Unix-based...

I have created a new mail account but I am unable to send/recieve mail or use webmail

When your domain is first created its resources are set to default values. You will need to...

When I try to send email I get the error 553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

If you get this message it most likely means that your outgoing mail requires authentication...

I get a Secure Connection Failed warning when logging into my control panel.

If you see a screen when logging into your control panel with an error message headed "Secure...