Temporary URL Handling

From Lunarpages Web Hosting Wiki
Jump to: navigation, search

PHP will not work with the temporary URLs that we provide before a site's name servers are changed to ours (ASP and JSP are similarly affected and the following will work for them as well). To work around this, you can add an entry to your computer's DNS resolver file. This way you can get right to work on your web site, without having the domain name resolving for the world, yet.

How to Get Started

Before beginning, you will need to know the server that your account is on and that server's IP address. The server you are on can be found in the account information e-mail sent to you when the account was confirmed.

If you are not familiar with how to perform a lookup, please go here: http://centralops.net/co/ and click on NSLOOKUP on the left column. Then type in the server that your account is on where it says domain and click the go button. The result will provide the IP address, here is an example using hydra.lunarpages.com.

Answer records 
name class type data time to live 
hydra.lunarpages.com IN A 64.235.234.13 1800s (30m)

In the above example, 64.235.234.13 is the IP address of the server.

Where is the Resolver File?

Here are the location for the resolver file, for a number of different operating systems out there:

Windows 95/98/ME

  • Filename = hosts
  • Location = x:\Windows

Windows 2000

  • Filename = hosts
  • Location = x:\WINNT\System32\Drivers\Etc

Windows XP/Vista/7

  • Filename = hosts
  • Location = x:\Windows\System32\Drivers\Etc

Mac OS X 10.x

  • Filename = hosts
  • Location = /etc

Linux

  • Filename = hosts
  • Location = /etc

Unix

  • Filename = hosts
  • Location = /etc

What to Change in Your Hosts File

Open the hosts file using Notepad, VI, or similar text editor. Do not use a word processor. Your file should contain the following line:

127.0.0.1       localhost

Add your server and domain information so that it looks like this:

127.0.0.1       localhost
64.235.234.13   yourdomain.com
64.235.234.13   www.yourdomain.com

Being sure to replace 64.235.234.13 with the IP address of the server your account is on. Create, upload and test your site. You will not be able to access your regular site while this file is modified as above.

When testing is complete, remove the line that you added to the hosts file and change your name servers as you normally would.

Share |
Want to read this in another language?