Haphy.com

Blog

Preview a live domain without changing DNS

This is a handy way of previewing a live domain name without changing it’s DNS records. I find this technique particularly useful when transferring the hosting of live websites. The instructions are for Mac OS X users.

  1. Open Terminal
  2. We need to edit the hosts file, so type “sudo pico /etc/hosts” and hit enter
  3. Enter your password
  4. Use the arrow keys to move the flasher down to create a new line beneath any of the other entries
  5. Type the IP address of the server, hit tab and type the domain name you wish to preview, e.g.
    01.23.45.67 haphy.com
  6. Press CTRL+X and type “y”, then hit enter to save your changes
  7. Visit http://haphy.com in your browser.

Notes

  • www.haphy.com will still function with the “real” DNS settings on your computer.
  • Remember, the server that you’re previewing needs to be setup to recognise your domain.
  • For some servers, you will need to enter the full domain (i.e. www.haphy.com) to your hosts file, and then visit that address in your browser - it depends on your setup.

Leave a Reply

© 2008 - Peter John Hartree: Freelance website developer based in Chichester, UK.