TL;DR
Virtual hosting lets a single server run multiple websites simultaneously, reducing infrastructure costs for businesses. It comes in three forms — Internet Protocol (IP)-based, name-based, and port-based — each with distinct trade-offs around complexity and browser compatibility. While companies like GoDaddy use it for commercial web hosting, organizations also deploy it internally to serve both public-facing sites and private intranets from one machine. Setting up virtual hosts requires careful configuration, and securing those servers is a critical operational concern.
What is virtual hosting?
A virtual host can run more than one website at a time. Configure it properly, and you'll have one machine that can load two, three, or more websites.
When we think about the internet, we think in terms of singularity. One website address resolves to one machine that holds all the content. Virtual hosting turns this idea on its head.
The main benefit to virtual hosting is it allows companies to host multiple websites (each with their own name and content) on a single server. This method allows companies to pay less, as they're sharing costs with many other organizations.
Virtual hosts are used in two main ways:
- External sales: Companies like GoDaddy and Wix host multiple websites on their servers. About 330,000 web hosting providers like this are available worldwide. They all offer some type of virtual web server.
- Internal traffic: Companies with an external-facing website and an internal-facing intranet might use a virtual host. They don't need two servers for this traffic.
What are the three types of virtual hosting?
Someone who wants to visit your website types in an address and hopes to end up in the right destination. Virtual servers handle that query in a few different ways.
You could base your virtual server on the IP address, the site name, or the port. The table below outlines how each type works and its potential drawbacks.
| Virtual Host Type | How It Works | Potential Drawback |
|---|---|---|
| IP-based | Uses a different IP address for each domain, all pointing to one server. | May run out of available IP addresses; requires tracking which address maps to each site. |
| Name-based | Uses one IP for all domains; queries visitors for the desired site during connection. | Some browsers may struggle to authenticate the site, causing security warnings or slow load times. |
| Port-based | Assigns each website to a different port on the server. |
Creating a virtual host can be complicated, and errors can keep people from visiting your site and finding out more about you.
If you have servers you need to keep secure, watch this video to learn about Okta Advanced Server Access.
Frequently asked questions
What is virtual hosting and how does it work?
Virtual hosting is a method that allows a single physical server to host multiple websites simultaneously. Rather than dedicating one machine to one domain, the server is configured to recognize and serve multiple domain names, each with its own content.
What are the main differences between Internet Protocol (IP)-based, name-based, and port-based virtual hosting?
IP-based hosting assigns a unique IP address to each domain on the same server. Name-based hosting uses a single IP address for all domains and identifies the correct site during the connection handshake. Port-based hosting routes each website through a different port on the server.
What are the drawbacks of name-based virtual hosting?
Name-based virtual hosting can cause compatibility issues with some browsers, which may flag the site as insecure or cause visitors to experience long load times while the server resolves the correct destination.
Why might a company use virtual hosting for internal traffic?
A company that runs both a public-facing website and a private intranet can use a single virtual host to serve both, eliminating the need to maintain two separate physical servers and reducing operational overhead.
How does virtual hosting reduce costs for businesses?
By hosting multiple websites on one server, organizations share the underlying infrastructure costs. This is the model used by commercial web hosting providers, where thousands of customers share server resources rather than each paying for dedicated hardware.
How can organizations keep their virtual servers secure?
Securing virtual servers requires careful configuration and access management. Solutions like Okta Advanced Server Access are designed to help organizations manage and secure access to their server infrastructure.
References
109+ Web Hosting Stats and Facts. (September 2021). Hosting Tribunal.