There is a file on your operating system which can be used to set domain name on the IP address until the domain is registered worldwide. Usually, it takes some time before the domain is registered after the order is submitted or it can take even more time (from 24 to 48 hours) for a domain to start working when you change your hosting provider and point a domain to a different server. Usually, your website does not have its own IP address and here comes the hosts file to help us. If the same IP address is used by several websites, you cannot access your website using IP address directly in the browser. This tutorial explains how to edit Windows
What you’ll need
Before you begin this guide you’ll need the following:
- Administrator rights on a Windows device.
- Your domain name set on the account and IP address which is set on your account by hosting provider (You can ask hosting provider to provide the IP address your website is using).
Step 1 — Running Notepad as Administrator
You need to run a text editor (Notepad is recommended) as administrator on your computer. Press on the Start button on your Windows, enter
Notepad with your keyboard-> Right-click on it and select Run as administrator. If you are prompted for an administrator password – enter it.
Step 2 — Opening hosts File
Once you’ve done so, open up the following file using the File -> Open feature:
c:\windows\system32\drivers\etc\hosts (Keep in mind, that All Files should be selected on your notepad dropdown area).
Step 3 — Editing hosts File With a Domain and IP Address
Now you should edit this file with the shared IP address on which your account is built and your domain name.
On this example, we have entered IP address (220.127.116.11) and domain name (www.yourdomain.com). Please keep in mind there shouldn’t be # sign at the beginning of the line otherwise it will not work.
Step 4 — Saving hosts File
Do not forget to save the changes which you have just made. Press the File button on the top left corner and select Save.
Step 5 — Entering The Website
Now you should be able to enter your website even without a domain name registered. Simply open the browser and enter the domain name you created in the hosts file. The files located on hosting server should be opened using it.
Please keep in mind this change works on the computer on which
hosts file is edited only. You cannot send a link to your friend to check the website until the domain is registered. You should also not forget to remove this line or comment it (using # at the beginning of the line) when the domain is already registered and working.