Subdomains and Virtual hosts
"vhost" and "sub-domain" are both concepts related to web hosting and server configuration, but they serve different purposes.
vhost (Virtual Host):
Virtual hosting refers to the practice of hosting multiple domain names (websites) on a single server.
A virtual host is a configuration method where a single physical server hosts multiple domains, and each domain is treated as if it has its own server.
This is typically achieved through the configuration of the web server software (such as Apache or Nginx) to respond differently based on the domain name requested by the client.
Virtual hosting allows a server to serve multiple websites with different domain names or IP addresses.
Sub-domain:
A sub-domain is a domain that is part of a larger domain. It is a prefix to the main domain name and is used to organize and navigate within the main domain.
Sub-domains are often used to create separate sections or branches of a website, each with its own unique content or purpose.
For example, in "blog.example.com", "blog" is a sub-domain of "example.com".
Sub-domains can be used to create separate websites, host different services (such as email or FTP), or categorize content within a single domain.
Difference:
The main difference between a vhost and a sub-domain is in their purpose and implementation:
A virtual host is a configuration setting that allows a single server to host multiple domains.
A sub-domain is a part of a larger domain, used for organizational or navigational purposes within that domain.
Relationship:
Sub-domains can be hosted using virtual hosting techniques. For example, a single server configured with virtual hosts could serve multiple sub-domains of a domain, each with its own separate configuration and content.
In summary, while both vhosts and sub-domains relate to web hosting and server configuration, a vhost refers to the configuration of a server to host multiple domains, while a sub-domain is a part of a larger domain used for organizational or navigational purposes. Sub-domains can be hosted using virtual hosting techniques.
Vhosts vs. Sub-domains
The key difference between VHosts and sub-domains is that a VHost is basically a 'sub-domain' served on the same server and has the same IP, such that a single IP could be serving two or more different websites.
VHosts may or may not have public DNS records.
In many cases, many websites would actually have sub-domains that are not public and will not publish them in public DNS records, and hence if we visit them in a browser, we would fail to connect, as the public DNS would not know their IP. Once again, if we use the sub-domain fuzzing
, we would only be able to identify public sub-domains but will not identify any sub-domains that are not public.
This is where we utilize VHosts Fuzzing
on an IP we already have. We will run a scan and test for scans on the same IP, and then we will be able to identify both public and non-public sub-domains and VHosts.
Name-based Virtual Hosting
The distinction for which domain the service was requested is made at the application level. For example, several domain names, such as admin.inlanefreight.htb
and backup.inlanefreight.htb
, can refer to the same IP. Internally on the server, these are separated and distinguished using different folders. Using this example, on a Linux server, the vHost admin.inlanefreight.htb
could point to the folder /var/www/admin
. For backup.inlanefreight.htb
the folder name would then be adapted and could look something like /var/www/backup
.
Last updated