Click to See Complete Forum and Search --> : Virtual hosting: "host not found" error: DNS?


q6z4k
11-25-2005, 09:13 AM
Hi!
I got a question, when I try to set virtual hosts I got "host not found". Can I set virtualhosts without using DNS server on my localhost, or do I need a DNS server too for localhost?

bwkaz
11-25-2005, 10:42 AM
Please don't hijack other people's threads. Thanks.

For your actual question -- virtual hosts do not automatically provide DNS. If you want your visitors to be able to get to your server by the virtual host name, you must set that name up in DNS to point to your IP address. Note that you don't need to run your own DNS server, you just need to set up the host record -- whoever's providing DNS for your "main" site can do this for you.

The only thing that (name-based) virtual hosting does is provide a different site based on the Host: header that gets sent in HTTP. (Browsers send a Host: header equal to whatever your user types into their address bar for the host portion of the URL.)