I tried to configure my dnsmasq to forward requests to different dns servers depending on the domain.
server=/a.example.org/192.168.a.a
server=/b.example.org/b.b.b.b
server=/c.example.org/8.8.8.8
Now caching doesn’t work for a and b. I always get the full TTL back.
192.168.a.a and b.b.b.b are the same DNS server. b.b.b.b is the authoritive DNS server for example.org so 8.8.8.8 forwards requests there.
When I watch what dnsmasq is doing I see this:
tcpdump -ni any src port 53 and not dst 127.0.0.1
07:14:45.680354 IP 192.168.a.a.53 > dnsmasq.36892: 400*- 1/0/1 A x.x.x.x (70)
07:14:45.713410 IP b.b.b.b.53 > dnsmasq.50966: 8767*- 1/0/1 A x.x.x.x (70)
07:14:45.770882 IP 8.8.8.8.53 > dnsmasq.35365: 3482 1/0/1 A x.x.x.x (70)07:14:55.850404 IP 192.168.a.a.53 > dnsmasq.20329: 11717*- 1/0/1 A x.x.x.x (70)
07:14:55.885077 IP b.b.b.b.53 > dnsmasq.39750: 21076*- 1/0/1 A x.x.x.x (70)07:15:05.965831 IP 192.168.a.a.53 > dnsmasq.21312: 34541*- 1/0/1 A x.x.x.x (70)
07:15:06.000209 IP b.b.b.b.53 > dnsmasq.48898: 28729*- 1/0/1 A x.x.x.x (70)
so dnsmasq caches only the request that went trough google first. What am I missing here? Why is dnsmasq not caching requests to a and b?