What is a Virtual Host?
A virtual host refers to the ability to host multiple domain name websites on a single server, or the functionality that enables this capability. By utilizing virtual hosting, multiple domains can be operated without the need to increase the number of servers. There are two primary types of virtual hosting: IP-based and name-based.
IP-based Virtual Hosting:
In this method, each domain name is assigned a unique IP address, and multiple IP addresses are allocated to a single server. Domain identification is handled at the network layer using the IP address, making this method compatible with a variety of applications. However, hosting many domains this way requires obtaining a large number of global IP addresses.
Name-based Virtual Hosting:
This approach links multiple domain names to a single IP address. The intended domain is specified in the protocol header at the application layer. For HTTP communications, the Host header is used to indicate the domain name of the virtual host. For HTTPS communications, SNI (Server Name Indication), an extension of SSL/TLS, is used to specify the domain.