Testing websites on a new IP

Created by Cyvan Oort at 16-08-2018 11:59:17 +0200

Since we are migrating a lot of customers don't really know what way to test their websites on the new platform. This article will try to explain how to do it.

Most likely you will receive an public IP address, this will look something like xxx.xxx.xxx.xxx where each x represents an number, these numbers can range between 1 and 255. This is the public address where the server with your website or service is found.

DNS or Domain Name System is the translation from a hostname (like initworks.com) to the public IP address, like the way a Zip code explains in what city you live. Now if we would like to test the website or service on another platform we need to tell our computer that the Domain Name should go to another IP. This could be done with an Host override, on each system this will work slightly different.


Windows

On Windows the following steps are required:

  1. Open Start
  2. Search for Notepad
  3. Richt click Notepad and click "Open as Administrator"
  4. Click file and open
  5. Now within the filebrowser go to the following directory C:\Windows\System32\Drivers\etc\
  6. Open the file called hosts
  7. At the bottem of this file add a line like this: "127.0.0.1 initworks.com" where 127.0.0.1 is replaced by the IP address you have received and initworks.com is replaced with the hostname of your website or service.
  8. Save the file.

Now if you would open your website or service within the browser it should show the website on the new server on your computer. You should now test all features of the website or service that you know and use, if you are done please don't forget to remove the line from the hosts file and save it again.


MacOS

On MacOS the following steps are required:


  1. Open the terminal (it should be located at /Applications/Utilities/Terminal.app)
  2. Enter the following command: "vim /private/etc/hosts"
  3. With the arrow keys move to the bottom of the file and press "o"
  4. You should now have the cursor on a new line, type "127.0.0.1 initworks.com" where 127.0.0.1 is replaced by the IP address you have received and initworks.com is replaced with the hostname of your website or service.
  5. When you are done, press ESC to stop editing.
  6. Then " : x " (no spaces) followed by an Enter to save and exit the file.

Now if you would open your website or service within the browser it should show the website on the new server on your computer. You should now test all features of the website or service that you know and use, if you are done please don't forget to remove the line from the hosts file and save it again. (To remove a line within vim just move the cursor to that line and press "d" key twice)


Linux

On Linux the following steps are required:

  1. Open the terminal (it should open with Ctrl + Alt + T)
  2. Enter the following command: "vim /etc/hosts"
  3. With the arrow keys move to the bottom of the file and press "o"
  4. You should now have the cursor on a new line, type "127.0.0.1 initworks.com" where 127.0.0.1 is replaced by the IP address you have received and initworks.com is replaced with the hostname of your website or service.
  5. When you are done, press ESC to stop editing.
  6. Then " : x " (no spaces) followed by an Enter to save and exit the file.

Now if you would open your website or service within the browser it should show the website on the new server on your computer. You should now test all features of the website or service that you know and use, if you are done please don't forget to remove the line from the hosts file and save it again. (To remove a line within vim just move the cursor to that line and press "d" key twice)

Comments

Comments are turned off.