How can I preview a site on its live domain?

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.

Note

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.
1

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 below for specific operating systems.

hostsfile-mac

2

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

3

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.

3

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.

Instructions for editing your hosts file popular operating systems

You can find direct instructions on how to modify your hosts file on various popular operating systems at this link.


  • Organizations

    Everything you need to know about managing your team with our Organizations feature.

    8 Articles
  • Blueprints

    Learn everything there is to know about what Blueprints are, how to create them and how to make the best use of them.

    5 Articles
  • Simple SSL

    All there is to know about our free, automatically installed and activated SSL certificates.

    8 Articles
  • Staging

    How to get the most out of Staging, which allows you to duplicate a site, make changes, and then push those changes to the live site.

    6 Articles
  • Local by Flywheel

    Everything you need to know about our amazing, free local WordPress development software for Mac and PC.

    5 Articles
  • White Label

    Everything you need to know about our Whitelabel subscriptions for branding and reselling Flywheel.

    4 Articles
  • Getting started

    Everything you need to know to get your first Flywheel site up and running.

    8 Articles
  • Frequently Asked

    The most commonly asked questions, and a few we just think you should know.

    24 Articles
  • General Questions

    Questions that don't fit elsewhere, or those about Flywheel in general.

    56 Articles
  • Billing & Accounts

    Questions relating to payments, billing and managing your account on Flywheel.

    12 Articles
  • Domain Names

    Details about how to manage DNS and point your domain names at Flywheel.

    10 Articles
  • Database

    How to access your WordPress database to make changes and update content.

    3 Articles
  • Security

    Details about everything Flywheel does to makes your site so secure.

    12 Articles
  • Plugins

    Which plugins work best, which plugins work worst, and everything in between.

    7 Articles

Get in touch with us

Standard support hours are M-F 9am-5pm CDT and 24/7 emergency support.

WordPress experts

Try it yourself. It's free & takes less than 60 seconds. Sign up

× How to manage 50+ WordPress Sites

Here's a free ebook!

How to manage 50+ WordPress Sites