• Follow
  • Follow
  • Follow


SYSTEM STATUS



1300 093 786

Domain Central Logo
  • Domain Names
    • Domain Registration
    • Domain Transfers
    • .au Direct
  • Web Hosting
    • WordPress Hosting
    • Plesk Hosting with SiteJet
    • Community Hosting
    • SSL Certificates
  • Email Solutions
    • Titan Mail
    • Microsoft 365
    • Office 365
  • Website Services
    • WordPress Maintenance and Support
    • Website Design
    • Ecommerce Shop Web Design
help Centre

Email

36
  • How to Archive IMAP Email Locally in Microsoft Outlook
  • How to Find and Provide Email Headers
  • Outlook Archiving Didn’t Reduce Email Storage (IMAP Accounts)
  • What is a DMARC Record and how do I create one: A Plain English Guide
  • Outlook
    • How to Archive IMAP Email Locally in Microsoft Outlook
    • How to Switch from the New Outlook to Classic Outlook on Windows
  • Microsoft 365
    • How to add a domain in Microsoft 365
    • How to add a user in Microsoft 365
    • How to configure email forwarders in Microsoft 365
    • How to change user permissions in Microsoft 365
    • Configuring 2FA in Microsoft 365
    • How to assign a license to a user in Microsoft 365
    • How to add/remove aliases in Microsoft 365
    • How to Create a User with Global Administrator Permissions in Microsoft 365
    • How to configure your Microsoft365 email account in Outlook
  • Smartermail
    • How to set up content filter rules for email accounts in SmarterMail
    • How to manage aliases in SmarterMail
    • How to configure Smartermail Email account on iPhone
    • How to change Mailbox Quota for SmarterMail account
    • What do I do when my SmarterMail Mailbox is Full?
    • How to purchase additional resources for your SmarterMail account
    • How to configure Smartermail Email account in Outlook & Mac Mail
    • Managing email accounts in SmarterMail
    • Password Changing in SmarterMail
    • How to configure Smartermail Email account on an Android device
    • How to enable Active Sync for your email in SmarterMail
    • Adding an image to your email signature in SmarterMail
    • How do I access the Smartermail Webmail Portal
  • Titan Mail
    • How to Log In to the Client Area and Set Up Your Titan Email Account
    • Download the Titan Mobile App
    • Setting up Titan on your iOS device
    • Setting up Titan on your Android device
    • Use Titan’s web version like a desktop app
    • How to setup an Email Alias in Titan
    • Creating and managing email signatures in Titan Mail
    • Configure Titan Mail in Microsoft Outlook

Domains

12
  • How to update WhoIs Information for a domain
  • How to setup an Email Domain Forwarder
  • How to setup a Domain Forwarder
  • How to Enable DNSSEC for Your Domain
  • .id.au Eligibility and Allocation
  • .asn.au Eligibility and Allocation
  • Eligibility & Allocation
    • .id.au Eligibility and Allocation
    • .asn.au Eligibility and Allocation
    • net.au Eligibility and Allocation
    • .org.au Eligibility and Allocation
    • .com.au Eligibility and Allocation
    • .au Direct Eligibility and Allocation

Error Codes

1
  • Outlook Error 0x800ccc0d or 0x800ccc0f

Getting Started

4
  • How to Log in to Plesk
  • Creating and Managing Support Tickets in the Client Area
  • How to login to the Client Area
  • Client Area vs. Control Panel; where do I go?

Web Hosting

44
  • Managing Your Website (Sites) in AdminBolt
  • How to Install WordPress in AdminBolt
  • How to Redirect a Page or Website Using .htaccess
  • How to Temporarily Point a Website to a Different IP Address Using the macOS Hosts File
  • How to Temporarily Point a Website to a Different IP Address Using the Windows Hosts File
  • How to purchase additional hosting resources
  • How to Create a DMARC Record in cPanel
  • Plesk
    • How to Remove a Subdomain in Plesk
    • How to Add a Subdomain in Plesk
    • How to Remove a Domain in Plesk
    • How to Add a New Domain in Plesk
    • How to Create a Database in Plesk
    • How to Check Disk and Bandwidth Usage in Plesk
    • How to Create a Directory or Files in Plesk File Manager
    • How to Upload Files via the Plesk File Manager
    • How to Change the Plesk Account’s Contact Details
    • How to Update a Plesk Account’s Email Address
    • How to Reset a Plesk Account Password
    • How to Change the Password of a Plesk Account
    • How to Log in to Plesk
    • How to Encrypt Database Password in Plesk Backup
    • How to Configure an FTP Backup in Plesk
    • How to Exclude Specific Files/Folders from the Plesk Backup
    • How to Generate a Full Backup in Plesk
    • How to Log In to Plesk and Enable AutoSSL
    • Using WP Toolkit in Plesk
  • WP Squared
    • Configure CDN on WP Squared
    • Add or Remove a Forwarding domain in WP Squared
    • How do I create a backup in WP Squared?
    • Using File Manager in WP Squared
    • Manage Files and Folders in WP Squared
    • Managing your website in WP Squared
    • How to Enable Two-Factor Authentication (2FA) in WP Squared
    • How to Disable or Reset Two-Factor Authentication (2FA) in WP Squared
    • How to Create a Staging Website Copy in WP Squared
    • How to Clear the NGINX Cache in WP Squared
    • How do I create my website in WP Squared?
    • How do I change/reset my WP Squared Hosting Password?
  • cPanel
    • How to Redirect a Page or Website Using .htaccess
    • How to Remove a CSR code in cPanel
    • How to Generate a Certificate Signing Request (CSR) in cPanel
    • How to Retrieve a CSR from cPanel
  • Admin Bolt
    • Managing Your Website (Sites) in AdminBolt
    • How to Install WordPress in AdminBolt

WordPress

22
  • How to Install WordPress in AdminBolt
  • Using WP Toolkit in Plesk
  • How to Change the WordPress User’s Display Name
  • How to Change the Password of a WordPress Account
  • How to Forcefully Update or Reinstall a WordPress Plugin
  • How to Delete Categories in WordPress
  • How to Delete an Uncategorised Category in WordPress
  • How to Add a New Category in WordPress
  • How to Bulk Delete Posts in WordPress
  • How to Remove a Post in WordPress
  • Simplifying Your Website’s Speed: A Step-by-Step Guide to Installing LiteSpeed Cache Plugin
  • Is LiteSpeed Cache Already Installed on Your WordPress Site? Here’s How to Check
  • How to Remove Sample Comments and Posts From WordPress
  • How to Deactivate and Delete a WordPress Plugin
  • How to Manually Install a WordPress Plugin
  • How to Delete a WordPress Theme
  • How to Manually Install a WordPress Theme
  • Litespeed WordPress Cache Plugin Configuration
  • How to Install a New WordPress Theme
  • How to Install a WordPress Plugin
  • How to Write and Publish Your First Blog Post in WordPress
  • How to Access the WordPress Admin Dashboard

DNS & Nameservers

1
  • How to add an SPF record for your domain from the client area

Transferring to Us

1
  • How to transfer your domain to Domain Central

Troubleshooting

7
  • How to perform a Traceroute
  • How to take a Screenshot for Support
  • How to Run a Traceroute to a Website from Your Computer
  • How to Let Our Support Team Access Your Windows 10 or 11 Computer Using Quick Assist
  • How to Clear the Browser Cache on Edge, Chrome, Safari, and Firefox
  • Is my website or the server down?
  • Outlook Archiving Didn’t Reduce Email Storage (IMAP Accounts)

Security

6
  • Has Your Email Address Been Pwned?
  • SSL Certificates
    • How to Log In to Plesk and Enable AutoSSL
    • How to Remove a CSR code in cPanel
    • How to Retrieve a CSR from cPanel
    • How to Generate a Certificate Signing Request (CSR) in cPanel
    • Do I need an SSL Certificate?
  • Home
  • Help
  • Web Hosting
  • How to Temporarily Point a Website to a Different IP Address Using the macOS Hosts File
View Categories

How to Temporarily Point a Website to a Different IP Address Using the macOS Hosts File

3 min read

The macOS hosts file allows you to temporarily direct a domain name to a specific IP address on your own computer without changing the website’s public DNS records.

This is commonly used when testing a website migration, previewing a website on a new server, or checking changes before DNS updates are made live.


What does the hosts file do? #

Normally, your Mac uses DNS servers to determine which IP address a website should load from.

The hosts file allows you to override this locally on your own Mac only.

  • The change only affects your Mac.
  • Public DNS is not changed.
  • Other visitors will still see the live website normally.
  • You can remove the change at any time.

Before you begin #

You will need:

  • The domain name you want to test.
  • The IP address of the server you want the domain to load from.
  • An administrator account on your Mac.

Example:

192.0.2.123 example.com
192.0.2.123 www.example.com

Step 1: Open Terminal #

  1. Open Finder.
  2. Go to Applications.
  3. Open the Utilities folder.
  4. Open Terminal.

Step 2: Edit the hosts file #

In Terminal, run the following command:

sudo nano /etc/hosts

Press Enter.

You will be prompted for your Mac administrator password. Type the password and press Enter.

Note: The password will not visibly appear while typing. This is normal behaviour in Terminal.


Step 3: Add the IP address and domain #

Use the arrow keys to move to the bottom of the file and add your entries.

Example:

192.0.2.123 example.com
192.0.2.123 www.example.com

Replace the example IP address with the server IP address you have been provided.


Step 4: Save the file #

After adding the entries:

  1. Press Control + O to save the file.
  2. Press Enter to confirm.
  3. Press Control + X to exit Nano.

Step 5: Flush the DNS cache #

After saving the hosts file, clear the macOS DNS cache by running:

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Press Enter.

You may be prompted for your password again.


Step 6: Test the website #

Open your web browser and visit the domain name.

Your Mac should now load the website from the IP address you entered in the hosts file.

If the website still loads from the old server:

  • Close and reopen your browser.
  • Try a private/incognito window.
  • Clear your browser cache.
  • Double-check the IP address and domain entries.

How to remove the hosts file entry #

Once testing is complete:

  1. Open Terminal again.
  2. Run:
sudo nano /etc/hosts
  1. Remove the lines you added.
  2. Save the file using Control + O.
  3. Exit using Control + X.
  4. Flush DNS again using:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Your Mac will then return to using the normal public DNS records.


Example hosts file entry #

If your new server IP is 203.0.113.50 and your domain is yourdomain.com.au, you would add:

203.0.113.50 yourdomain.com.au
203.0.113.50 www.yourdomain.com.au

Troubleshooting #

Permission denied

Make sure you use sudo when opening the hosts file.

The website still loads from the old server

Flush the DNS cache and restart your web browser.

The website shows an SSL warning

The SSL certificate may not yet be installed on the server you are testing.

The website does not load

Check that the IP address is correct and that the hosting server is configured for the domain.


Need help? #

If you are unsure which IP address to use or need assistance testing your website before DNS changes, please contact our support team.

Did you like this article ?

Share This Article :

  • Facebook
  • X
  • LinkedIn
Updated on August 20, 2026
How to Redirect a Page or Website Using .htaccessHow to Temporarily Point a Website to a Different IP Address Using the Windows Hosts File
Table of Contents
  • What does the hosts file do?
  • Before you begin
  • Step 1: Open Terminal
  • Step 2: Edit the hosts file
  • Step 3: Add the IP address and domain
  • Step 4: Save the file
  • Step 5: Flush the DNS cache
  • Step 6: Test the website
  • How to remove the hosts file entry
  • Example hosts file entry
  • Troubleshooting
  • Need help?
dc-logo

Subscribe to our Newsletter

Services

Web Hosting

Domain Registration

Email Solutions

Domain Transfer

Website Services

Company

About Us

Blog

Contact Us

Legal

Accessibility Statement

customer service



Help Centre



Existing Client Login



Sales Enquiries



System Status

customer service



Help Centre



Existing Client Login



Sales Enquiries



System Status

Services

Web Hosting

Domain Registration

Email Solutions

Domain Transfer

Website Services

Company

About Us

Blog

Contact Us

Legal

Accessibility Statement

© Copyright Domain Central ANZ 2025

Privacy Policy • Terms of Service 

  • Follow
  • Follow
  • Follow
Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behaviour or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}