Preview a live domain without changing DNS
Thursday, March 27th, 2008This 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.
- Open Terminal
- We need to edit the hosts file, so type “sudo pico /etc/hosts” and hit enter
- Enter your password
- Use the arrow keys to move the flasher down to create a new line beneath any of the other entries
- 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 - Press CTRL+X and type “y”, then hit enter to save your changes
- 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.