When moving a website to mybox, it is a best practice to verify that the files, database, and configuration are working perfectly on our infrastructure before you point your domain to our servers. Since your domain is still officially pointing to your old provider, you can use a “trick” called hosts file editing to see how the site performs on mybox specifically from your computer.
This method allows you to bypass global DNS settings and force your computer to connect directly to the mybox server IP for a specific domain name.
Table of Contents
Step 1: Obtain your mybox Server IP
To tell your computer where to look, you first need the IP address of your new hosting environment.
- Log in to your mybox panel and navigate to the Domains section.
- Select your domain, go to the Parked tab, and click Manage DNS.
- Look for the A record (it will have a green checkmark). Note the numerical IP address (e.g.,
123.123.123.123).
Note: You can also find this by pinging your FTP host: your-login.ftp.mybox.com.
Step 2: Edit the Hosts File
You need to add a line to your operating system’s internal “address book” using the following format: [Server IP] [domainname.com] [www.domainname.com]
For Windows
The file is located at C:\Windows\System32\drivers\etc\hosts.
- Search for Notepad in your Start menu, right-click it, and select Run as Administrator.
- In Notepad, go to File > Open and navigate to the path above (ensure “All Files” is selected in the bottom right).
- At the bottom of the file, add your entry:
123.123.123.123 yourdomain.com www.yourdomain.com - Save the file.
For macOS
- Open the Terminal application.
- Type the following command and press Enter:
sudo nano /private/etc/hosts - Enter your Mac administrator password.
- Use the arrow keys to go to the bottom and add:
123.123.123.123 yourdomain.com www.yourdomain.com - Press
Ctrl + Oto save andCtrl + Xto exit.
Step 3: Verify the Connection
Open your web browser (using an Incognito/Private window is recommended to avoid cache issues) and enter your domain name. You are now viewing the version of the site hosted on mybox.
To confirm you are on the new server, you can create a small test file via FTP (e.g., test.html with the word “Success”) and try to load yourdomain.com/test.html.
Distinction Block
Local vs. Global Changes Editing the hosts file only affects the computer you are currently using. The rest of the world will still see the website hosted at your old provider until you update the Nameservers (NS) or A record at your domain registrar.
Practical Implications
- Cleanup: Once you have verified the site works and you have officially updated your domain delegation, remember to remove or comment out (using a
#at the start of the line) the entries in your hosts file. Leaving them in can cause confusion if the server IP ever changes in the future. - SSL Certificates: You may see a security warning in your browser during this test if an SSL certificate hasn’t been issued for the domain on the mybox server yet. This is normal and can usually be bypassed for testing purposes.
- Database Links: This is the perfect time to check if your WordPress or other CMS links are working correctly and aren’t still trying to pull images or scripts from the old server’s IP.
Summary
Editing the hosts file is the safest way to perform a “pre-flight check” of your mybox infrastructure. It allows you to troubleshoot migration issues in a private environment, ensuring a seamless transition for your visitors when you finally flip the switch on the global DNS.