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

I was wondering is there a way to configure a linux or windows machine to use separate nameservers depending on what domain is being queried.

Like for internal.example.com it resolves to 192.168.10.7 for example and for the rest go through google at 8.8.8.8.

The Primary reason for this would be use in a VPN.

share|improve this question
    
Have a +1 to counteract the completely unjustified -1 someone gave you. –  John Gardeniers Apr 4 '12 at 5:25

3 Answers 3

The usual way to handle this is to configure your own DNS server that forwards requests for non-local domains to other DNS servers.

share|improve this answer

I can't answer for Windows, but this capability (selecting nameservers based on the domain name being queried) is not available under Linux. It is available on OS X, where it is extremely useful for exactly the reason you've described.

Under OS X, you use the scutil command to manipulate domain-specific DNS servers. It ain't pretty!

Here's a script that uses scutil to set up DNS for OpenVPN. In fact, you'll often find scutil discussed in the context of open-source VPN solutions like OpenVPN, vpnc, etc.

share|improve this answer
    
I've never heard of this functionality in OS X. How do you configure this stuff? DNS in the Advanced Network Dialog doesn't offer any way to differentiate the servers per domain. –  Sven Apr 4 '12 at 1:19

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.