[Dnsmasq-discuss] resolving specific domains with dnsmasq
Nikolay Borisov
n.borisov.lkml at gmail.com
Mon Oct 2 09:18:31 BST 2017
Hello,
I'd like to use dnsmasq to resolve only certain domains with specific
dns server and everything else with my router's dns. Here is the config
that I have:
===dnsmasq.conf===========
domain-needed
listen-address=127.0.0.1
server=/xxxxxx/8.8.8.8
server=/xxxxxx/8.8.8.8
server=/imap.suse.de/#
except-interface=virbr0,tun0
conf-file=/etc/dnsmasq.d/domains.conf
interface=br0
bind-interfaces
dhcp-range=192.168.8.2,192.168.8.254
================ domains.conf ============================
server=/xxxxxx/10.160.0.1
server=/xxxxxx/10.160.0.1
server=/xxxxxxx/10.160.0.1
server=/xxxxxxx/10.160.2.88
server=/xxxxx/10.160.2.88
server=/xxxxxxx/10.160.2.88
server=/.10.in-addr.arpa/10.160.2.88
========/var/run/dnsmasq/resolv.conf===========
nameserver 10.160.0.1
nameserver 10.160.2.88
nameserver 10.20.1.1
So 10.160.x are the dns server that come from a vpn connection and
10.20.1.1 is the dns that my router gives me (the default, catch-all one).
The problem is that due to the presence of the vpn dns's in
dnsmasq/resolv.conf they are being used also for resolving upstream
domains such as google.com. I tried removing the 10.160x servers from
resolv.conf and they got re-added automatically upon restarting dnsmasq.
I'm using ubuntu 16.04 and also disabled dnsmasq management from
NetworkManager side:
cat /etc/NetworkManager/NetworkManager.conf
[main]
#dns=dnsmasq
However, that didn't help.
What I want to achieve seems to be one of the cannonical uses of dnsmasq
but I don't know how to limit the vpn dns's to be used _only_ for the
domains in domains.conf and not being added as generic upstream servers
in nameserver.
More information about the Dnsmasq-discuss
mailing list