1

I'm trying to run two instances of dnsmasq on a raspberry pi, I've gotten quite far. I'm currently trying to get the first dnsmasq server to forward any request it doesn't know the answer to to the second server but it only seems to be working if I dig <address> @127.0.0.1. Using the external addresses of the either interface, or querying from another machine doesn't do it.

Querying either server directly gets the desired result, but trying to get the first server to forward results from the second... not so much.

Config for instance A (lan):

root@Raspberry-server:~# cat /etc/dnsmasq/dnsmasq.conf

port=53
except-interface=eth0.1
bind-interfaces

no-hosts
#changing the cache size makes no difference
#cache-size=5000
cache-size=0

# uncomment to forget about 404 responses
#no-negcache

#resolv-file=/etc/dnsmasq/resolv.lan.conf
#no-poll
no-resolv
strict-order

server=192.168.1.13

auth-server=raspberry.lan,eth0
auth-zone=lan,192.168.1.0/24
host-record=raspberry.lan,192.168.1.11
host-record=htpc.lan,192.168.1.10
host-record=tom.lan,192.168.1.12

Config for instance B (global):

root@Raspberry-server:~# cat /etc/dnsmasq/dnsmasq.blocker.conf

port=53
bind-interfaces
listen-address=192.168.1.13

no-hosts
addn-hosts=/etc/dnsmasq/blocked.host
cache-size=100000

# uncomment to forget about 404 responses
#no-negcache

resolv-file=/etc/dnsmasq/resolv.blocker.conf
#no-poll

strict-order

Instance A status log:

systemd[1]: Starting DNSMasq Lightweight DNS server...
dnsmasq[1651]: dnsmasq: syntax check OK.
dnsmasq[1656]: started, version 2.76 cache disabled
dnsmasq[1656]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify
systemd[1]: Started DNSMasq Lightweight DNS server.
dnsmasq[1656]: using nameserver 192.168.1.13#53
0

Turn on query logging (log-queries) and use dig/nslookup against each server in turn.

In your current setup serverB looks like it will never ask any other server for information. Server A should pass queries to Server B when it cannot answer them itself.

Dnsmasq servers attempt to resolve the query locally, forwarding only if necessary. Enabling query logging should show you which server you're hitting and when, and what they do with that query.

0

Have a look at /etc/default/dnsmasq. In some distributions, this file prevents to read "resolv.conf" files other than /etc/resolv.conf.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.