How to access a namebased website without a DNS record

If you want to access a name based website that you created e.g. in ISPConfig before the DNS records are setup, edit the hosts file on your workstation computer and add a line like this:

Replace the IP address with the IP of your server and with the domain name of the website.

The hosts file on Linux and MAC systems is /etc/hosts, on Windows systems the hosts file is:


The above trick also works if you want to run a website in your internal network (intranet) without having a DNS server available for local DNS resolving.

5 thoughts on “How to access a namebased website without a DNS record”

  1. Terrific piece of information to know. I had to use it to check on a web site before DNS servers were updated and it worked great. Very slick. Thanks.

  2. If you are on Vista or Windows 7, you may need to either disable UAC or run notepad as administrator, then open the hosts file otherwise you will be unable to save it.

  3. Avatar

    This way is not good. If you are behind of transparent proxy, hosts file modification is not effective. So problem exists.

    I even cannot comment here from office :))

  4. Avatar

    For MacOSX, the way to edit the /etc/hosts file is possible with the following command :
    sudo /Applications/ /etc/hosts

  5. Avatar

    for mac, just enter in terminal;

    sudo nano /etc/hosts

    use “control + x’ to exit ans save


Leave a Comment