<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[NuBlue - Viewing Development Websites Using Your Hosts File]]></title>
	<link rel="self" href="http://www.nublue.co.uk/forums/feed/atom/topic/243/"/>
	<updated>2010-09-09T13:54:56Z</updated>
	<generator>PunBB</generator>
	<id>http://www.nublue.co.uk/forums/topic/243/viewing-development-websites-using-your-hosts-file/</id>
		<entry>
			<title type="html"><![CDATA[Re: Viewing Development Websites Using Your Hosts File]]></title>
			<link rel="alternate" href="http://www.nublue.co.uk/forums/post/652/#p652"/>
			<content type="html"><![CDATA[<h2>Editing your Hosts File in OSX</h2><p>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 -&gt; Utilities -&gt; Terminal.</p><p>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.</p><div style="padding: 10px 0 10px 0;"><pre class="brush: plain;">sudo nano /private/etc/hosts </pre></div><p>Type your user password when prompted.</p><p>Once the file opened, you will need to append your site details to the end of the file as with the windows guide above.</p><div style="padding: 10px 0 10px 0;"><pre class="brush: plain;">IP_ADDRESS    DOMAIN_NAME
IP_ADDRESS    www.DOMAIN_NAME</pre></div><p>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.</p>]]></content>
			<author>
				<name><![CDATA[NuBlue-Luke]]></name>
				<uri>http://www.nublue.co.uk/forums/user/4/</uri>
			</author>
			<updated>2010-09-09T13:54:56Z</updated>
			<id>http://www.nublue.co.uk/forums/post/652/#p652</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Viewing Development Websites Using Your Hosts File]]></title>
			<link rel="alternate" href="http://www.nublue.co.uk/forums/post/615/#p615"/>
			<content type="html"><![CDATA[<h2>Editing your Hosts File in Windows</h2><p>One method of previewing/developing a site that is not live (ie you&#039;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.</p><p>To do this you need to know your domain name, the IP address we&#039;re hosting it on (You can find this information in your Hosting Control Panel under Setup), and you&#039;ll need to have administrator privileges on your computer.</p><p>On Windows XP the hosts file is located within here : windows\system32\drivers\etc\hosts&nbsp; .&nbsp; 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.</p><p>Navigate to this file in Windows Explorer, if you find you can&#039;t view any of the listed directories you will need to enable Hidden Program or System Files (See guide <a href="http://www.microsoft.com/windowsxp/using/helpandsupport/learnmore/tips/hiddenfiles.mspx" rel="nofollow">here</a>.&nbsp; Once located right click and choose to edit the file in Notepad.</p><p>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 : </p><div style="padding: 10px 0 10px 0;"><pre class="brush: plain;">IP_ADDRESS    DOMAIN_NAME
IP_ADDRESS    www.DOMAIN_NAME</pre></div><p>Here&#039;s an example using my domain name and using my correct IP address : </p><div style="padding: 10px 0 10px 0;"><pre class="brush: plain;">92.63.138.66    pagrant.co.uk
92.63.138.66    www.pagrant.co.uk</pre></div><p>Save the file and you&#039;re done (If you can&#039;t save the file then you won&#039;t have administrator privileges and you&#039;ll need to login as an administrator account).&nbsp; To test ping your domain and it should return the IP address you entered in the hosts file, not the live IP address.</p><p>To reverse, simply delete the two lines, save, flush your dns (ipconfig /flushdns in a command prompt) and retest using ping.</p>]]></content>
			<author>
				<name><![CDATA[NuBlue-Paul]]></name>
				<uri>http://www.nublue.co.uk/forums/user/5/</uri>
			</author>
			<updated>2010-06-24T12:13:51Z</updated>
			<id>http://www.nublue.co.uk/forums/post/615/#p615</id>
		</entry>
</feed>

