How to configure virtual hosts on Apache on Windows

If you are using Apache on your Windows machine and want to set up virtual hosts so you can type something like this “www.myDomain.tst” in your browser and it’ll direct you to your local hosted site … you have to edit this file:

C:\WINDOWS\system32\drivers\etc\hosts

Add a new line with this text
127.0.0.1  myDomain

Open apache\conf\extra\httpd-vhosts.conf file and add these lines:

<VirtualHost *:80>
DocumentRoot path_to_your_document_root
ServerName myDomain
</VirtualHost>

Free DNS

There are a number of free DNS that you can use:

  • Google’s 8.8.8.8
  • Quad9’s 9.9.9.9
  • CloudFlare’s 1.1.1.1
  • OpenDNS  208.67.222.222
  • Norton 199.85.126.20
  • CleanBrowsing 185.228.168.168
  • Comodo DNS 8.26.56.26

Here is a good article comparing DNS for speed and features

For the speed results, The Top 5 DNS are:

Global Average Speed:

  1. CloudFlare: 4.98 ms
  2.  Google: 16.44 ms
  3.  Quad9: 18.25 ms
  4.  CleanBrowsing: 19.14 ms
  5.  Norton: 34.75 ms