Save 50% for your first year of web hosting!

How can I see what my website looks like before I change the DNS?

If you have just switched web hosts and want to make sure everything looks right before changing your DNS, you can do so by editing your .hosts file.

On your computer, you have a .hosts file. This file acts like a local DNS server where you can point any domain name to any IP address without affecting anyone else.

Despite the process seeming complicated, it is entirely possible to make these changes yourself in just a few minutes. This guide will show you how to edit the .hosts file on both Mac and Windows.

Edit the .host file on Mac:

Video: https://www.youtube.com/watch?v=NxorxEaB1Uk

To edit the .hosts file on a Mac, you must first open Terminal. Terminal can be found in Applications > Utilities. Once Terminal is open, type the following command in the terminal:

sudo nano /etc/hosts

to open the .hosts file in the Nano text editor. You will be prompted to enter your password first.

Once the .host file is open, you can begin making your changes. We need to add a line with the IP address followed by the domain name. If your new IP is 127.0.0.1 for example, and your domain name is example.com, add the following line to point example.com to 127.0.0.1:

127.0.0.1 example.com

After you have added the line, save the file and exit by pressing Control + X.

Edit the .hosts file on Windows:

Video: https://www.youtube.com/watch?v=AC6hs_1_yOI

To edit the .hosts file on Windows, you first need to open a text editor with administrative privileges. Notepad is a simple option that’s available on all Windows computers. Search for Notepad in the Start menu, right-click the icon, and select “Run as administrator”.

When Notepad is open, navigate to File > Open and browse to C:Windows/System32/drivers/etc/hosts. Make sure to change the file type from Text Documents (*.txt) to All Files so you can see the .hosts file. Select the file and click “Open”. Now you can make your changes just like on a Mac.

When you’re finished, save the file by selecting File > Save or by pressing Control + S.

Was this article helpful?

Tack för din feedback!