Virtual Server and Shared Hosting tend to be different things although it doesn't affect my answer.
A single server (physical or virtual, it doesn't matter) can host websites for many different domains.
Each domain name will resolve to the same IP address, that of the server in question.
So www.example.com resolves to 198.51.100.21, but so does www.example.org. They're both hosted on the same server.
So when you ping www.example.com and www.example.org you get the same response, that's exactly how it should be if they are hosted by the same server.
Note: even if two domains resolve to different IP addresses, they could potentially be hosted on the same server, because a single server can support multiple IP addresses.
You can look up the IP address of server names / fully qualified domain names / web sites using tools like dig
or nslookup
. For example,
nslookup www.google.com
Non-authoritative answer:
www.google.com canonical name = www.l.google.com.
Name: www.l.google.com
Address: 74.125.113.103
Name: www.l.google.com
Address: 74.125.113.104
Name: www.l.google.com
Address: 74.125.113.105
Name: www.l.google.com
Address: 74.125.113.106
Name: www.l.google.com
Address: 74.125.113.147
Name: www.l.google.com
Address: 74.125.113.99
When web servers host multiple sites (or domains), then the server needs to know which domain you're trying to get to (the name), and the IP address is not enough. This is why,
http://198.51.100.21/something
isn't usually possible with servers that have multiple domains hosted (especially true of web hosting providers).
There are many other reasons why using the IP address is undesirable as well.
I like to think of this like postal addresses. It's not sufficient to know someone's postal address (like a server IP address), you have to know their name as well (like the website domain) and write that on the letter. If you don't, you just know their mom (i.e. the default web site) is going to open it and read it.