Previewing Your Website Before DNS Changes (Firstserv Guide)

If you want to test your website before updating your DNS, you can do so by editing your hosts file. This allows your computer to load your domain from your Firstserv server instead of the live site, without affecting other visitors.


How It Works

By editing your hosts file, you map your domain name to your hosting server’s IP address locally on your device.

✅ This lets you:

  • Preview your site before going live
  • Test changes safely
  • Avoid downtime during migrations

Editing the Hosts File (Windows)

Step 1: Locate the Hosts File

The file is located at:

C:\Windows\System32\drivers\etc\hosts

Step 2: Open as Administrator

  1. Right-click Notepad → select Run as Administrator
  2. In Notepad, go to File → Open
  3. Navigate to the path above
  4. Change file type to All Files to see the hosts file
  5. Open hosts

Step 3: Edit the File

Add the following entries at the bottom:

127.0.0.1 localhost
X.X.X.X yourdomain.com
X.X.X.X www.yourdomain.com

Replace:

  • X.X.X.X with your Firstserv server IP
  • yourdomain.com with your actual domain

Step 4: Save and Test

  • Save the file
  • Restart your browser (or use an incognito/private window)

✅ Your domain should now load from the Firstserv server.


Editing the Hosts File (macOS)

Step 1: Open Terminal

  • Open Terminal via Applications → Utilities or Spotlight

Step 2: Edit the Hosts File

Run:

 
 
 
 
 
 
Shell
 
 
sudo nano /private/etc/hosts
 
 

Enter your password when prompted.


Step 3: Add Your Entries

Add the following:

127.0.0.1 localhost
X.X.X.X yourdomain.com
X.X.X.X www.yourdomain.com

Replace:

  • X.X.X.X with your server IP
  • yourdomain.com with your domain

Step 4: Save Changes

  • Press Ctrl + O → press Enter to save
  • Press Ctrl + X to exit

Step 5: Flush DNS Cache (Optional)

To apply changes immediately:

 
 
 
 
 
 
Shell
 
 
sudo dscacheutil -flushcache
``
 
 

Step 6: Test Your Site

  • Open your browser or use a private/incognito window
  • Visit your domain

✅ Your site should now load from your Firstserv server.


Important Notes

  • This change only affects your device, not the public internet
  • Other visitors will still see your existing live site
  • Remember to revert/remove entries once testing is complete

Summary

By editing your hosts file, you can:

  • Preview your website before DNS changes
  • Test migrations safely
  • Verify functionality without downtime

If you need help finding your server IP or testing your site before going live, the Firstserv support team is always happy to assist.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to disable LiteSpeed connection timeouts

LiteSpeed Timeouts Explained (Firstserv Guide) What is LiteSpeed? All Firstserv hosting...

What file and directory permissions should I use for my web files?

File & Directory Permissions (Firstserv Guide) Setting the correct file and directory...

Where should I upload my website files?

Where Should I Upload My Website Files? (Firstserv Guide) The Short Answer Your website...

How to clear your web browser cache

How to Clear Your Browser Cache (Firstserv Guide) Web browsers store cached data such as...

Using FileZilla to upload files via SFTP(SSH) or FTPS(SSL/TLS)

Setting Up FileZilla (Firstserv Guide) FileZilla is a free, open-source FTP client available...