Take the 2-minute tour ×

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?


share|improve this question

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

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

3 Answers 3

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

share|improve this answer

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.

share|improve this answer

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 " myhost.com"), then provided ip will be used. Elsewhere hostname will be resolved via default DNS server.

share|improve this answer

Your Answer


