Preview Your Website Before DNS Changes
To preview your new website hosted with Krystal without changing your DNS name servers, edit the hosts
file on your PC or Mac to map your domain to the new server IP. This approach ensures you can test the new site while your existing one remains live.
Editing the hosts
File on Windows
- Locate the File:
- Windows NT/2000/XP/2003/Vista/7/8/10/11:
C:\Windows\System32\drivers\etc\hosts
- Open in Notepad (as Admin):
- Right-click Notepad > select Run as Administrator.
- In Notepad, go to File > Open, navigate to the file path above.
- Change file type from Text Documents (.txt) to All Files to see the
hosts
file. - Select and open hosts.
- Edit the File:
- Make a backup by using Save As.
- Add the following entries, replacing
X.X.X.X
with your server’s IP andexample.com
with your domain:
127.0.0.1 localhost
X.X.X.X example.com
X.X.X.X www.example.com
Example:
127.0.0.1 localhost
77.72.0.106 mydomain.co.uk
77.72.0.106 www.mydomain.co.uk
- Save Changes and Restart Browsers:
- Your site should now load from the Krystal server - Please try using an incognito/private browser if this does not work immediately.
Editing the hosts
File on Mac
- Open Terminal:
- Use Spotlight or go to Applications > Utilities > Terminal.
- Edit the File:
- Type
sudo nano /private/etc/hosts
, then enter your user password when prompted.
- Type
- Add Entries:
- Add the following entries, replacing
X.X.X.X
with your server’s IP andexample.com
with your domain:
- Add the following entries, replacing
127.0.0.1 localhost
X.X.X.X example.com
X.X.X.X www.example.com
Example:
127.0.0.1 localhost
77.72.0.106 mydomain.co.uk
77.72.0.106 www.mydomain.co.uk
Save and Exit:
- Press Control-O to save, Enter to confirm, and Control-X to exit.
Flush DNS Cache (Optional):
- For immediate changes, type
dscacheutil -flushcache
in Terminal.
Your site should now load from the Krystal server - Please try using an incognito/private browser if this does not work immediately.