meenakshi sundaram
2018-03-05 15:37:23 UTC
Hi All,     I would like to know the behavior of dnsmasq in the following scenario
PC --- Dnsmasq-as-Forwarder-------- |------ DNS-Server1 { abc.123.com ---- 1.1.1.1, abc.123.com ---- 1.1.1.2}Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |--------DNS-Server-2 Â { abc.123.com ---- 1.1.1.3, abc.123.com ---- 1.1.1.4}
When PC sends the query for abc.123.com, Dnsmasq forwards queries to both DNS-servers. Both servers sends the reply.PC Â receives only one reply with answer from either DNS-Server1 or DNS-Server2. Â it is expected as per design.Â
I was expecting the dnsmasq-forwarder  to cache the replies/answers from both servers( Server1's reply {abc.123.com ---- 1.1.1.1, 1.1.1.2} Server2's reply {abc.123.com ---- 1.1.1.3, 1.1.1.4)} .
When i checked the cache of dnsmasq-forwarder, it only caches the first reply from either DNS-Server1 or DNS-Server2, NOT both.Â
So wondering, how to do the RoudRobin Load balancing among four servers(1.1.1.1/2/3/4) which serves abc.123.com.Â
 i checked the code. Looks like " the after  processing first reply, the frec is freed, so dnsmasq can't cache the entries."
Could you explain?Â
thanksS.Meenakshisundaram
PC --- Dnsmasq-as-Forwarder-------- |------ DNS-Server1 { abc.123.com ---- 1.1.1.1, abc.123.com ---- 1.1.1.2}Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â |--------DNS-Server-2 Â { abc.123.com ---- 1.1.1.3, abc.123.com ---- 1.1.1.4}
When PC sends the query for abc.123.com, Dnsmasq forwards queries to both DNS-servers. Both servers sends the reply.PC Â receives only one reply with answer from either DNS-Server1 or DNS-Server2. Â it is expected as per design.Â
I was expecting the dnsmasq-forwarder  to cache the replies/answers from both servers( Server1's reply {abc.123.com ---- 1.1.1.1, 1.1.1.2} Server2's reply {abc.123.com ---- 1.1.1.3, 1.1.1.4)} .
When i checked the cache of dnsmasq-forwarder, it only caches the first reply from either DNS-Server1 or DNS-Server2, NOT both.Â
So wondering, how to do the RoudRobin Load balancing among four servers(1.1.1.1/2/3/4) which serves abc.123.com.Â
 i checked the code. Looks like " the after  processing first reply, the frec is freed, so dnsmasq can't cache the entries."
Could you explain?Â
thanksS.Meenakshisundaram