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:        www.mydomain.com

Replace the IP address with the IP of your server and www.mydomain.com 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.

How to access a namebased website without a DNS record
Tagged on:         

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

  • November 6, 2009 at 4:25 am

    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.

  • February 14, 2010 at 6:55 pm

    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.

  • May 12, 2010 at 9:09 am

    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 :))

  • October 3, 2010 at 2:27 am

    For MacOSX, the way to edit the /etc/hosts file is possible with the following command :
    sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /etc/hosts

  • March 1, 2013 at 3:55 pm

    for mac, just enter in terminal;

    sudo nano /etc/hosts

    use “control + x’ to exit ans save


Leave a Reply

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