Menu

Preview a site on its live domain

Updated on August 18th, 2023

When preparing a site for launch, it can often be useful to test the site on the Flywheel server and live domain prior to making any DNS changes. This is possible by editing your hosts file.

Editing your hosts file allows you to point a domain to a specific IP address on your personal computer only. In particular, this method is often used when testing large multisites, as it’s far less error prone than swapping to temporary domains throughout your entire database.

Warning

Hey there! This help doc should be approached with caution. Only make changes to your hosts file if we’ve told you to make those changes or if you’re absolutely sure this is what you’re supposed to be doing.

Locate your hosts file

All operating systems have a way to accomplish this task, but the process  and syntax is slightly different in each OS. You can find instructions here for specific operating systems.

hostsfile-mac

Note

Using a Mac? Try the app Gas Mask – you can even create multiple host files and switch between them.


Modify your hosts file

When you’ve located your hosts file, you’ll need to add at least two pieces of information: the IP address you want the site to resolve to and the domain.

For example, adding the below two lines will point www.domain.com and domain.com to the IP address 173.255.230.60. You’ll obviously want to add your live site’s domain name, and the IP address of your new Flywheel server. These entries are separated in your hosts file only by a single space.

Flywheel IP Address Your domain name
174.255.230.60 www.domain.com
174.255.230.60 domain.com

hostsfile-edited-mac


Set your primary domain in Flywheel

Once you’ve modified your hosts file, you’ll need to prepare your Flywheel site to work with the domain you added to your hosts file. You can learn about setting your Primary domain name here. Make sure you add the domain exactly as you added it to your hosts file previously – they should match.


Save and test

Once you’ve added the proper domain and IP information as noted above, you can save the file and visit the domain in your browser. It should now load like normal, but from the Flywheel server – not your current host. Once you’ve completed your testing, you should remove these modifications from your hosts file.

Note

These changes only affect your local computer – not any visitors over the internet.

Need help?

If you have any questions our Happiness Engineers are here to help!

Was this article helpful?

Getting Started

New to Flywheel? Start here, we've got all the information you'll need to get started and launch your first site!

View all

Account Management

Learn all about managing your Flywheel user account, Teams and integrations.

View all

Billing

Everything about billing, invoices and payments can be found here.

View all

Features

Flywheel hosting plans include a ton of great features. Learn about how to get a free SSL certificate, set up a staging site, and more!

View all

Platform Info

All the server and setting info you'll need to help you get the most out of your Flywheel hosting plan!

View all

Site Management

Tips and tricks for managing your sites on Flywheel, including going live, troubleshooting issues and migrating or cloning sites.

View all

Developer Hub

Learn how to connect, deploy, and more with SSH on Flywheel's platform.

View all

Growth Suite

Learn more about Growth Suite, our all-in-one solution for freelancers and agencies to grow more quickly and predictably.

View all

Managed Plugin Updates

Learn more about Managed Plugin Updates, and how you can keep your sites up to date, and extra safe.

View all

 

Flywheel help

Help is just a click away! Log into Flywheel dashboard to instantly chat with an expert, respond to a ticket, or follow along with in-depth documentation. We happily offer support 24 hours a day, 7 days a week, 365 days a year!

Log in

Try Flywheel today

Launch your next WordPress site in minutes.

 Free migrations  24/7/365 support  14 day demo sites