I have wondered: When hosting a domainname (nameservers) at one place and having a webserver for eg. wordpress another place. How do the webserver know what website I want to show if I just point the A record to the webserver IP, where there is hosted 100+ websites?
When you type in a domain in your browser, the DNS server associated will resolve the IP and send a request to the server associated with that IP.
A hostname is sent with the request to the server which hosts the website. The server then uses this information and determines which website to show the user.
Essentially the server is responsible for knowing what domains are associated with it and showing the appropriate website when a request is made.
Keep in mind that if a direct request via the IP is made, the server will then not have any hostname information and not know which website to display.