Faysal Ahamed

Full-stack Web Developer

Access website without active domain name

by Faysal Ahamed · 2 minutes read · #domain #dns #hostfile

Sometimes you host a website but you do not have an active domain or maybe your DNS is not updated yet but you want to visit the site-

You can do it very easily by updating your host file.

Let say the domain name is example.com and we host this website in a shared hosting and added example.com as the domain.
Similarly if someone host in Cloud Droplet or VPS, and they created vhost and added the domain name in their web server correctly, then the website is also accessible in this way.

Find the IP of the hosting. let say IP is 127.0.0.1

Linux/Ubuntu users can easily update the host file:
sudo nano /etc/hosts

Windows users need to open the notepad as administrator and find the host file at
c:\windows\system32\drivers\etc\hosts
Here you will find details instruction to find and edit host file:
How to Edit Your Hosts File on Windows, Mac, or Linux

See YouTube video to edit host file

After opening the host file, go to the bottom of the file and add the following and save:
127.0.0.1 example.com

Done! Now go to your browser and visit example.com

DO NOT FORGET TO DELETE THE DOMAIN FROM HOST FILE ONCE YOU ORIGINAL DOMAIN IS ACTIVE.