How to access a namebased website without a DNS record

If you want to access a namebased 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 C:\Windows\system32\drivers\etc\hosts

The above trick also works if you want to run a website in your internal network (intranet) without having a DNS server availalble 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. 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. For MacOSX, the way to edit the /etc/hosts file is possible with the following command :
    sudo /Applications/ /etc/hosts

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>