Occasionally you might have to go through an IP address change. This could be due to your hosting account being migrated to a new server, getting an SSL Certificate installed (which requires a unique IP Address) among other reasons.

Depending on your ISP DNS Cache policy it may take several hours before you are able to access your website using the domain name, so with this guide we aim to give you a simple workaround by manually adjusting the host file on your computer to point to the new domain IP. This will bypass any DNS Cache issues from your ISP and can get you back to work instantly.

Please note that this is considered an advanced system modification mainly because it has the potential to break stuff if you don’t follow the steps precisely or care much for your input while performing the commands bellow. If you are unsure on how to proceed with the following steps we advise you hang tight and wait for DNS propagation which can take up to 48 hours but generally is completed in much less than that.

Please be aware that we STRONGLY advise you make a backup of your current host file BEFORE making changes to it. This will help you get things back to normal in the event you make a mistake or get stuck at some point and want to revert changes.

Editing your host file is rather simple but instructions vary if you are on a MAC or if you are under Windows. So lets begin with Windows.

Windows users

  • Open your start menu and find “Notepad” from your applications.
  • Right click on “Notepad” and click “Run as Administrator” (if you do not do this you wont be able to save the file later).
  • Once Notepad is open, click on “File -> Open…
  • In the file browser window, enter the following where it says “File Name”: %systemroot%\system32\drivers\etc\
  • Click the drop down box right next to the “File Name” box and select “All Files“.
  • From the list of files, select the “hosts” file and click open.
  • Near the bottom of this file you might see some entries that look something like: 127.0.0.1 localhost. Any line that begins with # is commented (this means it will not affect what the file does). Create a new line at the end and make sure it DOES NOT begin with a #.
  • Enter your IP address followed by a blank space or a tab and enter your domain name next to it. For reference take this: 173.208.32.162 cherry.freshwebservers.com
  • Save the file and you are done.

If you try to visit your domain name it should now get a reply from the correct IP address if you followed the steps above correctly.

Mac users

  • Open the Mac’s Terminal. You may either type Terminal on the Spotlight, or by going into Applications -> Utilities -> Terminal.
  • Open the hosts file for editing. In the terminal window you just opened copy/paste the command string below, and press return.  sudo nano /private/etc/hosts
  • You’ll be prompted to enter your Mac user’s password. NOTE: you won’t see the cursor move. This is normal, so press return when done.
  • Near the bottom of this file you might see some entries that look something like: 127.0.0.1 localhost. Any line that begins with # is commented (this means it will not affect what the file does). Create a new line at the end and make sure it DOES NOT begin with a #.
  • Enter your IP address followed by a blank space or a tab and enter your domain name next to it. For reference take this: 173.208.32.162 cherry.freshwebservers.com
  • Be sure to place domain.com with your actual domain name. If you’re not sure which IP address to use, please contact our Support Department for further assistance.
  • Save save your changes by pressing control-o on your keyboard then return to accept the filename. Exit the editor by pressing control-x. This takes you back to the terminal screen.
  • You may need to flush your Mac’s DNS cache, so copy/paste the below command string into terminal, and press return. dscacheutil -flushcache
  • You may have to add sudo to this command, for example: sudo dscacheutil -flushcache
  • If you are NOT running Yosemite, as a last precaution to ensure cache is clear you should run this: sudo killall -HUP mDNSResponder
  • You are done.
Did this answer your question?