[Dnsmasq-discuss] dnsmasq can use different upstream servers for different clients?

Ledge . ledge00 at ymail.com
Sat Dec 19 02:58:32 GMT 2015


DNSmasq is setup on my Asus rt-ac68u router, along with openvpn.I've configured openvpn as a vpn client so the router connects to an openvpn server.Openvpn has been setup with selective routing so only a few machines on the lan use the VPN.
The openvpn server pushes it's own DNS servers to my openvpn client.Currently, the openvpn client overwrites the /tmp/resolv.conf file with the vpn DNS servers.  This provides the entire lan with the VPN DNS servers.  DNSmasq has been configured to use the /tmp/resolv.conf file using the "--resolv-file" option.
When the openvpn client stops, the /tmp/resolv.conf file is restored to its original (non-vpn dns server) values.
What would be better is to only use the openvpn DNS servers for a few (dnsmasq) clients on the lan.

The "--server" option can use different upstream DNS servers for different resolvable domains by using the format "--server=/domain/dnsserv"Can dnsmasq be configured to use different upstream DNS servers for different clients on the lan?
I noticed some people suggested the following solution:
dhcp-host=<mac-addr>,net:vpnclient
dhcp-option=vpnclient,6,<dnsserv1>,<dnsserv2>
This has the effect of sending to the given client (by <mac-addr>) the DNS servers <dnsserv1> and <dnsserv2>.  However, as the client hasn't connected to the VPN (only the router is connected), this solution doesn't work as the client can't find a route to the VPN's DNS servers.
Is it possible to specify different "--server" options with different lan clients?
Thanks in advance.
Ledge.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20151219/819d729f/attachment.html>


More information about the Dnsmasq-discuss mailing list