This is a general networking question.
Suppose that I have a web server in a machine XYZ with 2 or more physical network adapters with IP's A, B, C and D.
If I access the web application in the machine with it's hostname, which IP will be used?
Thanks.
that depends on what hostname you're going to use and where that hostname is pointing to. let's say you have the following DNS entries:
so depending on whether you use hostname1 or 2 or 3 or 4 you'd hit different IPs. to find out the IP just type
nslookup hostname
In the general, the IP number that maps to that hostname, via DNS or whatever other mapping system is in place. For specifics, https://serverfault.com/ is the place to go.
It depends of configuration of client host and it DNS server. For example if in client hosts file(in *nix it is /et/hosts) consist you hostname(i.e. entry with text "56.34.23.111 myhost.com"), then provided ip will be used. Elsewhere hostname will be resolved via default DNS server.