priority of /etc/hosts

Hi

We’ve have a machine(A) with two ports and two ip add (196.240.x.y) and (10.10.x.y)!
On the linux box, I’ve configured this machine (A) with the following ip add (10.0.x.y) in the /etc/hosts.
I’ve configured the /etc/resolv.conf with the nameservers.

Now, when I make a nslookup A, I receive the following response : (196.240.x.y) but I want receive the other…

So, why linux doesn’t check the /etc/hosts first?
How to resolv my problem?

Thanks

nslookup, as the name suggests, only does DNS lookups and doesn’t look at /etc/hosts.

Ok… that’s mean that the /etc/hosts will be prioritize on other command like ping, ssh and so on?

Not necessarily. The order is determined in /etc/nsswitch.conf. On openSUSE it is:

hosts: files mdns4_minimal [NOTFOUND=return] dns

So /etc/hosts will be checked first.

It’s great… thanks for your help!
nm