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.

Does anyone know if it's possible to limit queries to a specific name server using dnsmasq? As an example:

All queries for anything on 172.16.0.0/12 should only be answered by server A. All queries for the Internet should only be answered by server B

In this case server A is my ISPs main name server and it handles queries for the Internet and also the customers Intranet (the 172 network) Unless I use their name server I cannot access resources on the Intranet. However, I also wish to use a VPN but the ISPs name server leaks on dns leak test.

I have looked at the server=/ section of the dnsmasq man page but I can't tell whether it will work for the scenario described above.

Thanks

share|improve this question
    
Are you querying PTR records? –  slimsuperhero Mar 4 '13 at 10:10
    
No, straight forward lookup. –  Pulse Mar 4 '13 at 10:15

1 Answer 1

You just need to state the following in your dnsmasq.conf:

server=/ispdomain.tld/1.2.3.4

Queries to any host in ispdomain.tld would be answered by 1.2.3.4, where 1.2.3.4 is your ISP's main name server.

And "server B"'s IP address should be stated in /etc/resolv.conf as this:

nameserver 7.8.9.0

share|improve this answer
    
Thanks for the reply. I have tried this before but it doesn't prevent the isp name server from answering Internet requests and thus leaking. –  Pulse Mar 4 '13 at 22:04
    
It SHOULD answer Internet requests as well, but it is your right to use it for resolving only several domains while using "server B" for other requests. –  slimsuperhero Mar 5 '13 at 6:18
    
I appreciate it should answer Internet queries but that's what I'm trying to prevent. –  Pulse Mar 5 '13 at 23:10
    
Suggested setup in my answer should work. Using server A or server B depends on domain name queried. What's exactly wrong with it? –  slimsuperhero Mar 6 '13 at 7:28

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.