Simple Trick When Switching Hosting

I’ve switched web hosts more times than I care to admit at this point, and I can tell you that by far the most painful part of the move is getting everything set up before you move the DNS over to the new server.

One very simple trick that I have used the past few times I have switched is to hijack your local machine’s ‘host’ file, allowing you to temporarily ignore what the DNS servers of the world-wide-tubes are telling you.

In Windows Vista, this file is located at C:\Windows\System32\drivers\etc\hosts and can be opened with any text editor (On Linux machines, this file is located at /etc/hosts).

For the purpose of this discussion, these files have the same format (although I believe the Linux hosts file supports the optional alias parameter while the Windows version doesn’t).

While I was working on realjenius.com and all variants, I registered the appropriate domain names in my host file so the rest of y’all could still hit the old host while I was configuring everything. For example, the IP address of realjenius.com is 74.47.204.79, so I had several entries like this:

74.47.204.79 realjenius.com
74.47.204.79 www.realjenius.com
74.47.204.79 eclipse.realjenius.com
74.47.204.79 static.realjenius.com

After flushing my browser cache, I was able to get to the new host quietly and peacefully, and make sure everything was set up.

Of course, you can always just use another domain name (I also have realjenius.net for example), and move that domain early - but you never really know everything is going to work until you hit is with all domain name variants (it’s easy to mis-type a ServerAlias directive after all).

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.