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.

link|improve this question

33% accept rate
feedback

migrated from stackoverflow.com Feb 15 '10 at 7:46

This question came from our site for professional and enthusiast programmers.

3 Answers

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:

hostname1 IN A IP_1
hostname2 IN A IP_2
hostname3 IN A IP_3
hostname4 IN A IP_4

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

link|improve this answer
feedback

In the general, the IP number that maps to that hostname, via DNS or whatever other mapping system is in place. For specifics, http://serverfault.com/ is the place to go.

link|improve this answer
feedback

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.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.