You are not logged in. Please login or register.
Web Hosting » Support » NuBlue Forums » NuBlue Hosting Guides » Viewing Development Websites Using Your Hosts File
Viewing Development Websites Using Your Hosts File
Editing your Hosts File in Windows
One method of previewing/developing a site that is not live (ie you're developing it on our server under its correct domain name, but the A record or nameservers point to a live site hosted elsewhere) is to edit your hosts file to bypass DNS and force your local machine to look for a domain on our hosting.
To do this you need to know your domain name, the IP address we're hosting it on (You can find this information in your Hosting Control Panel under Setup), and you'll need to have administrator privileges on your computer.
On Windows XP the hosts file is located within here : windows\system32\drivers\etc\hosts . The windows directory is most likely located on your C: drive, but if your computer setup differs from the norm it could be located elsewhere.
Navigate to this file in Windows Explorer, if you find you can't view any of the listed directories you will need to enable Hidden Program or System Files (See guide here. Once located right click and choose to edit the file in Notepad.
Append to the bottom of the file the following 2 lines, replacing IP_ADDRESS with the IP Address you took from the Hosting Control Panel and DOMAIN_NAME with your domain :
IP_ADDRESS DOMAIN_NAME IP_ADDRESS www.DOMAIN_NAME
Here's an example using my domain name and using my correct IP address :
92.63.138.66 pagrant.co.uk 92.63.138.66 www.pagrant.co.uk
Save the file and you're done (If you can't save the file then you won't have administrator privileges and you'll need to login as an administrator account). To test ping your domain and it should return the IP address you entered in the hosts file, not the live IP address.
To reverse, simply delete the two lines, save, flush your dns (ipconfig /flushdns in a command prompt) and retest using ping.
Editing your Hosts File in OSX
To edit your hosts file on OSX you first need to open the terminal app. You can do this by start typing Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.
Once the terminal is open you need open your hosts file for editing. You can do this by typing the following command into the terminal.
sudo nano /private/etc/hosts
Type your user password when prompted.
Once the file opened, you will need to append your site details to the end of the file as with the windows guide above.
IP_ADDRESS DOMAIN_NAME IP_ADDRESS www.DOMAIN_NAME
When done editing the hosts file, press control-o to save the file, press enter on the filename prompt and control-x to exit the editor.
Web Hosting » Support » NuBlue Forums » NuBlue Hosting Guides » Viewing Development Websites Using Your Hosts File







