How to access a name based 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 set up, edit the hosts file on your workstation computer and add a line like this:

192.168.0.100        www.mydomain.com mydomain.com

Edit hosts file on macOS X

To edit the hosts file on a computer running macOS X, use this command:

sudo nano /etc/hosts

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

Windows 10 hosts File location

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 available for local DNS resolving.

Leave a Comment