Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

On a win32 multiple nic computer, how to force DNS resolving through gethostbyname() on a specific nic if all nics have different DNS configured and have the same metric ?

Otherwise, how to know which DNS will be used to resolve names each time a gethostbyname() call will be performed by the application ?

share|improve this question

1 Answer 1

I don't believe you can. Windows will choose the DNS servers assigned to the most preferred "up" interface. However, you can change the order of interface preference. In XP (and probably 2003):

  1. Open Control Panel.
  2. Open Network Connections.
  3. Go to the Advanced menu and choose Advanced Settings.

You will see a list of all interfaces (real or virtual) on the computer, and you can rearrange them however you wish.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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