When you’re moving a website to Bragghost, you may want to test it on our servers before you point your domain’s DNS. This way, you can make sure everything is working correctly without taking your live site offline.
The best way to do this is by editing your computer’s hosts file. This lets you tell your computer to load your domain from Bragghost’s server, while the rest of the world still sees your site at the old location.
Windows Instructions
Step 1: Find Your Server IP Address
-
Log in to your Bragghost client portal.
-
Scroll down to the Your Active Products/Services section.
-
Select Log in to cPanel, next to your hosting package.
-
Copy the Shared IP Address under the General Information section located at the top right of the page.
- You should also be able to find this IP address in your New Account Information email when you purchased hosting from us.
Step 2: Open the hosts file:
-
Open Notepad as Administrator (right-click → Run as Administrator).
-
Locate the hosts file on your computer. Typically, for Windows 7, 8, 10 and 11 it's located in the path below:
-
C:\Windows\System32\drivers\etc
-
Step 3: Add your domain entry
-
Before editing the hosts file, you may want to make a backup copy of the file (with a different filename), just in case. You can either leave the copy in the same folder (Windows will ignore it as long as it’s not named exactly
hosts) or move it to a safe place like your Desktop or Documents folder. After you have created the backup copy, you can then edit your original hosts file. -
By default, a Windows hosts file should be similar to the following:
-
127.0.0.1 localhost
-
-
You can add additional lines to this file that will point requests for a particular domain to your new server's IP address. Example:
-
(Replace the above IP and domain with your actual info.)127.0.0.1 localhost198.51.100.45 yourdomain.com
198.51.100.45 www.yourdomain.com
-
Step 4: Save and Test Your site
- After you add your IP and domain save your changes and close Notepad.
-
You will also need to flush your DNS cache. Type cmd in your Windows search bar, right-click on Command Prompt, and click Run as administrator.
-
Type in:
ipconfig /flushdnsand hit the enter key.
-
- Restart any open browsers and then visit your website in the browser of your choice!
Step 5: Remove the entry later once your DNS has been updated and propagated.
Mac Instructions
Step 1: Find Your Server IP Address
-
Log in to your Bragghost client portal.
-
Scroll down to the Your Active Products/Services section.
-
Select Log in to cPanel, next to your hosting package.
-
Copy the Shared IP Address under the General Information section located at the top right of the page.
- You should also be able to find this IP address in your New Account Information email when you purchased hosting from us.
Step 2: Open the hosts file:
-
Open Terminal inside your Utilities Folder (Applications -> Utilities -> Terminal)
-
To be on the safe side, you should backup your existing host file, in case you need to revert back to it. Simply copy/paste the following command and hit return:
-
sudo cp /private/etc/hosts /private/etc/hosts-orig
-
-
After you have create the backup copy, you can then edit your host file. Simply copy/paste the following command and hit return:
-
sudo nano /private/etc/hosts
-
-
You will be prompted to enter your admin password for your Mac user. Enter it just like you're logging onto your computer and press return.
-
This will bring up your host file which looks something like this:
Host Database## localhost is used to configure the loopback interface# when the system is booting. Do not change this entry.##127.0.0.1 localhost255.255.255.255 broadcasthost::1 localhost
Step 3: Add your domain entry
-
At the bottom of the file, add your domain and IP address, for example:
(Replace the above IP and domain with your actual info.)Host Database
#
# localhost is used to configure the loopback interface# when the system is booting. Do not change this entry.##127.0.0.1 localhost255.255.255.255 broadcasthost::1 localhost
198.51.100.45 yourdomain.com
198.51.100.45 www.yourdomain.com
Step 4: Save and Test Your site
- After you add your IP + domain press Control + X to exit nano and Y and press return to commit the changes.
-
Once this has been completed, you need to flush your local DNS by typing this command and pressing return:
-
dscacheutil -flushcache
-
Step 5: Remove the entry later once your DNS has been updated and propagated.
Both the Windows and Mac methods are quick and reliable ways to preview your website on Bragghost servers before you update your DNS. By taking just a few minutes to edit your hosts file, you can be confident that your site is working exactly as expected before going live to the public.