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.

I have two network adapters on my PC each connected to a different network (one LAN and one Wireless). I set up routing tables to have some of the addresses routed to the LAN and others to the Wireless, but I'm having problems with the DNS configuration. I'd like the DNS lookup to first try the default DNS for the LAN and then if there was no match, try the default DNS for the wireless.

The problem is that DNS servers (and hence their order) are defined per network connection. I can't figure out which of the DNS's are used when I try to i.e. ping a server by name.

Is there a concept of a primary network adapter?

Can I create or manage a global list of DNS servers without regard to the adapter?

share|improve this question
add comment

5 Answers 5

up vote 7 down vote accepted

You can prioritize one adapter over another. Read through this article for how to do it.

However, when you say "I'd like the DNS lookup to first try the default DNS for the LAN and then if there was no match, try the default DNS for the wireless.", that is not going to work. Your LAN DNS Server, if available, will either resolve the name for you, answer that the name does not exist, or refer you to another DNS server. While you might think that the third option would be your ticket, understand that the DNS resolver in Windows (an most other systems) is a stub resolver that can not follow referrals, and so your DNS query will fail at that point.

If what you truly want is to get the internal IP adresses of your systems when you are connected through your LAN, and external resolved addresses when connected outside, or in general for any external names. This can be achieved by setting up split DNS on your LAN DNS server.

share|improve this answer
    
Changing the priority order of the adapters was what I needed, thanks! –  gooli Jun 7 '09 at 14:28
add comment

Due to the metric of the connection, a DNS lookup should always pick LAN over WLAN. As long as the routing table is showing a lower metric for the LAN connection than the WLAN, it should be working the way you want.

If you need to verify your metrics per connection, you should be able to look at the IP address in the interface column to get the corresponding metric. Physical interfaces should have the same metric for all entries. Virtual interfaces (and loopback) will gave different metrics based on the physical connection they are using for the given entry. (This KB article explains how the Automatic Metrics are assigned.)

If you want to ensure a specific order to the DNS servers, you can define a prefered order list at "Connection Properties>Internet Protocol(TCP/IP) Properties>Advanced>DNS". This list will need to be defined on each connection.

share|improve this answer
    
How can I check what is the metric for each connection? The "route print" command shows a metric for each entry of the routing table, but AFAIK doesn't show the metric for the connection / adapter. –  gooli Jun 7 '09 at 14:24
    
I added some information above to try and address your question. –  KevinH Jun 8 '09 at 11:15
add comment

I have had somewhat the same problem; and I don't think you can configure a list of DNS servers to be asked, when domain information is needed. See this question.

When Windows asks the first name server; it will either return the address, or NXDOMAIN, indicating that the address cannot be resolved.

share|improve this answer
    
Is there a way to change that by installing a local DNS server that will try other DNS servers in order? Sounds like it should be fairly simple to implement... –  gooli Jun 7 '09 at 14:22
add comment

can you explain some more about the two different works, are they connected to two different LAN domains eg siteA.local and siteB.local? If the answer is yes, then you can treat them in the same way as LAN and VPN, below is a brief explanation of how to get name resolution for a separate domain over VPN - it will help to show how to use different DNS's for different connections.

  • When creating a new VPN connection add the IP address for DNS - this is the obvious part.
  • Now go to your Network Connections in Control Panel, right-click on either LAN/WLAN/VPN and look at the properties, then select TCP/IP and click Properties, click Advanced and go to the DNS tab, select the radio button for "Append these DNS suffixes (in order)" and add the "other" domain eg siteB.local, click OK and OK and OK to return to the Control Panel.

This automatically happens when you join a domain, but has to be forced to work with name resolution on separate networks.

If you don't want to make this change and you know the FQDN (fully qualified domain names) and you have specified the DNS IP for the LAN and WLAN, you should get resolution when you do eg: ping server1.siteA.local or ping server1.siteB.local

share|improve this answer
add comment

I had the same issue, the DNS of the VPN was preferred but I needed the DNS of the LAN connection to be used.

Changing the metric of the LAN connection to a low value (e. g. 1) solved the problem:

Properties of the LAN Connection -> IPv4 properties Advanced...

Uncheck "automatic" and set a low value

share|improve this answer
add comment

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.