When you register a new domain or change hosting providers, it can take up to 48 hours for your domain to "point" to your new hosting account (this is called DNS propagation). During this waiting period, you can't access your website using your domain name.
The hosts file is a simple text file on your computer that acts like a personal phone book for websites. By editing it, you can tell your computer exactly where to find your website, bypassing the need to wait for DNS propagation.
Think of it like this: Instead of waiting for the phone copany to update everyone's phone book, you're writing the new number directly in your personal address book.
You'll need two pieces of information from your hosting welcome email:
yoursite.co.nz)1. Open Notepad as Administrator
2. Open the hosts file
C:\Windows\System32\drivers\etc\3. Add your website
YOUR_SERVER_IP yoursite.co.nz YOUR_SERVER_IP www.yoursite.co.nz
YOUR_SERVER_IP with the IP address from your hosting emailyoursite.co.nz with your actual domain name4. Save and test
1. Open Terminal
2. Edit the hosts file
sudo nano /etc/hosts
3. Add your website
YOUR_SERVER_IP yoursite.co.nz YOUR_SERVER_IP www.yoursite.co.nz
YOUR_SERVER_IP with the IP address from your hosting emailyoursite.co.nz with your actual domain name4. Save and exit
1. Open Terminal
2. Edit the hosts file
sudo nano /etc/hosts
3. Add your entries (same format as Mac)
4. Save and exit (Ctrl+X, then Y, then Enter)
âš ï¸ Remember to remove these entries later!
Once your domain is fully propagated (usually within 24-48 hours), you should remove the lines you added to your hosts file. If you don't, your computer will always try to access the old server instead of following normal DNS.
If your server IP is 198.51.100.50 and your domain is myawesomesite.com, you would add:
198.51.100.50 myawesomesite.com 198.51.100.50 www.myawesomesite.com
Not working?
Still having issues?
Contact our support team - we're happy to help walk you through this process!
This method only works on the computer where you edited the hosts file. Other devices will still need to wait for DNS propagation.
Tags: Hosts, DNS, Propogation