Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I use a VPN to connect my development machine to my school's CS dept. The development machine is Ubuntu as we do C programming in Unix. I used vpnc to do that. The school uses some DNS entries that only resolve on their DNS servers, i.e., internalserver.csdept.school.edu

I am normally attached to the VPN whenever booted for convenience. However I noticed the other day that when I disconnect the VPN all my DNS queries fail. This obviously means that vpnc set up the school's DNS to be used. However I'd rather not use their DNS all the time (tracking and privacy and whatnot). Is there a way I can restore my ISP's DNS and then if the lookup fails, have it use my school's DNS?

share|improve this question

migrated from serverfault.com Apr 16 '12 at 2:26

This question came from our site for professional system and network administrators.

2 Answers 2

Not really, because resolution through your ISP's DNS will not "fail". It will return "no result" which is not a failure. It is technically possibly to setup a convoluted situation on your PC where you could direct various queries to different DNS servers based on what domain you're tying to lookup; but I'd highly advise against doing something like that as it's likely to cause more problems than it's worth.

share|improve this answer
    
Hmmm, this is troubling. (Not that I'm try to hide anything from my university Whistles nonchalantly). What, in Linux, handles DNS lookups? Is it possible to write a short program to wrap it that would use a regex to match "^.*\.school\.edu$" and treat it specially? –  Huckle Apr 16 '12 at 2:32
2  
dnsmasq can be configured to resolve different domains form different servers quite easily. –  BillThor Apr 16 '12 at 22:38

vpnc hacks /etc/resolv.conf. Here are several links that deal with this issue:

  1. Ubuntu Jaunty vpnc setup
  2. CentOS vpnc setup

You might be also able to solve this problems with the resolvconf package.

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.