0

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

Pulse
  • 1

1 Answers1

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

gevial
  • 1,324
  • 9
  • 13
  • 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 04 '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. – gevial Mar 05 '13 at 06:18
  • I appreciate it should answer Internet queries but that's what I'm trying to prevent. – Pulse Mar 05 '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? – gevial Mar 06 '13 at 07:28