Score:1

dnsmasq ignores result from IPV4 upstream servers when there is IPV6 upstream server (non reachable) also configured

cn flag

We have configured dnsmasq for caching dns responses to improve the dns response time. It woks fine until there was only an IPV4 upstream server is configured.

In a different environment with IPV4 and IPV6, where IP addresses and dns servers details are provided by DHCP, DNS resolution is not working.

This machine has IPV4 address, one IPV4 dns server and 3 IPV6 dns servers configured by DHCP, there was issue in configuring IPV6 address, so it failed to configure IPV6 address. So the device has an IPV4 address, an IPV4 dns server and 3 IPV6 dns servers configured in eth0.

When tried to do dig hostname, it failed with "Temporary failure in name resolution" after some time. Actually, the IPV4 dns server is reachable and it could respond to dns query (it works when did dig @IPV4server hostname) but didn't get the response some how.

Further checking the packet capture, when a dig hostname was requested, dns request was sent to all the upstream servers and IPV4 dns server responded back while the IPV6 upstream servers are not reachable.

Could some one please clarify the following

  1. As per dnsmasq man page, when there are multiple upstream servers present, it will send the dns request to only one server until --all-servers options is configured. Why in this case the request is sent to all the servers?
  2. When the IPV4 upstream server responded back with reply, why that is not considered and dns request is failing?
  3. Is there any order/preference which dnsmaq use to choose dns server address to forward the request.

Below is the TCP dump taken while dns request request is sent, which shows IPV4 upstream server have responded.

16:17:20.266462 IP 10.x.x.17.51705 > 10.x.x.20.domain: 15715+ A? facebook.com. (30)
16:17:20.266566 IP6 fe80::2d04:2479:e0a0:8677.60098 > 2001:x:x::x:20.domain: 15715+ A? facebook.com. (30)
16:17:20.266602 IP6 fe80::2d04:2479:e0a0:8677.60098 > 2001:x:x::x:22.domain: 15715+ A? facebook.com. (30)
16:17:20.266636 IP6 fe80::2d04:2479:e0a0:8677.60098 > 2001:x:x::x:34.domain: 15715+ A? facebook.com. (30)

    **16:17:20.268080 IP 10.x.x.20.domain > 10.x.x.17.51705: 15715 1/0/0 A 157.240.22.35 (46) --> Response from IPV4 upstream server

16:17:25.271834 IP 10.x.x.17.51705 > 10.x.x.20.domain: 2104+ A? facebook.com.searchdomain1.lab. (41)
16:17:25.273270 IP 10.x.x.20.domain > 10.x.x.17.51705: 2104 NXDomain 0/1/0 (116)
16:17:25.273581 IP6 fe80::2d04:2479:e0a0:8677.60098 > 2001:x:x::x:20.domain: 1302+ A? facebook.com.searchdomain.com. (42)
16:17:25.273618 IP6 fe80::2d04:2479:e0a0:8677.60098 > 2001:x:x::x:22.domain: 1302+ A? facebook.com.searchdomain.com. (42)
16:17:25.273659 IP6 fe80::2d04:2479:e0a0:8677.60098 > 2001:x:x::x:34.domain: 1302+ A? facebook.com.searchdomain.com. (42)
16:17:30.278138 IP6 fe80::2d04:2479:e0a0:8677.60098 > 2001:x:x::x:20.domain: 1302+ A? facebook.com.searchdomain.com. (42)
16:17:30.278177 IP6 fe80::2d04:2479:e0a0:8677.60098 > 2001:x:x::x:22.domain: 1302+ A? facebook.com.searchdomain.com. (42)
16:17:30.278217 IP6 fe80::2d04:2479:e0a0:8677.60098 > 2001:x:x::x:34.domain: 1302+ A? facebook.com.searchdomain.com. (42) 

EDIT 1: Tried again today, now the node got IPv6 address, still the IPV6 servers are not reachable. Could see the IPV4 server with dns entry have responded but still the command says "connection timed out; no servers could be reached"

09:07:16.348333 IP (tos 0x0, ttl 64, id 21050, offset 0, flags [DF], proto UDP (17), length 75)
10.115.153.176.nimspooler > 10.xx.xx.20.domain: [bad udp cksum 0xaf89 -> 0x29ec!] 36262+ A? s2.0583.proxy-s2-5.fmtest.lab. (47)
09:07:16.348415 IP (tos 0x0, ttl 64, id 18221, offset 0, flags [DF], proto UDP (17), length 75)
10.115.153.176.nimspooler > 10.xx.xx.109.domain: [bad udp cksum 0x804c -> 0x5929!] 36262+ A? s2.0583.proxy-s2-5.fmtest.lab. (47)
09:07:16.348493 IP6 (hlim 255, next-header UDP (17) payload length: 55) 2001:10:115:152::158:3.41736 > 2001:xx:xx::1:20.domain: [bad udp cksum 0x445d -> 0xad91!] 36262+ A? s2.0583.proxy-s2-5.fmtest.lab. (47)
09:07:16.348547 IP6 (hlim 255, next-header UDP (17) payload length: 55) 2001:10:115:152::158:3.41736 > 2001:xx:xx::1:20.domain: [bad udp cksum 0x445f -> 0xad8f!] 36262+ A? s2.0583.proxy-s2-5.fmtest.lab. (47)
09:07:16.348602 IP6 (hlim 255, next-header UDP (17) payload length: 55) 2001:10:115:152::158:3.41736 > 2001:10:10::1:34.domain: [bad udp cksum 0x4471 -> 0xad7d!] 36262+ A? s2.0583.proxy-s2-5.fmtest.lab. (47)
09:07:16.349109 IP (tos 0x0, ttl 63, id 33379, offset 0, flags [DF], proto UDP (17), length 91)
       ***10.xx.xx.109.domain > 10.115.153.176.nimspooler: [udp sum ok] 36262* q: A? s2.0583.proxy-s2-5.fmtest.lab. 1/0/0 s2.0583.proxy-s2-5.fmtest.lab. A 192.168.1.5 (63)***
09:07:16.349824 IP (tos 0x0, ttl 126, id 26992, offset 0, flags [none], proto UDP (17), length 150)
10.xx.xx.20.domain > 10.115.153.176.nimspooler: [udp sum ok] 36262 NXDomain q: A? s2.0583.proxy-s2-5.fmtest.lab. 0/1/0 ns: . SOA a.root-servers.net. nstld.verisign-grs.com. 2021080500 1800 900 604800 86400 (122)

[admin@fm-release ~]$ host -v s2.0583.proxy-s2-5.fmtest.lab
Trying "s2.0583.proxy-s2-5.fmtest.lab"
;; connection timed out; no servers could be reached
Michael Hampton avatar
cz flag
This system does not appear to have global IPv6 connectivity. You can't reach IPv6 destinations without it. Check your Internet connection.
Mahudees avatar
cn flag
Yes @MichaelHampton, working on that with lab team to fix the IPV6 connectivity. But in this case, request sent to one of the upstream server (IPV4) responded back with IP address. Not sure why that is not considered as dns response. This situation could happen in production deployments, where one dns server could go down or network might not be reachable.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.