This happens when Netflix is running on an Xbox on the network, I don't think a regular URL would cause it. I did some more testing with tcpdump running and found the following - I'm not a network engineer so bear with me:
With the regular DNS servers set ("working" environment set to 1.1.1.1) it seems all the DNS queries and replies from the Xbox involving Netflix are done over UDP. When it is set to one of the "bad" environments, for some reason the Netflix app isn't satisfied with the first UDP reply so it does another request via TCP instead of UDP. After this TCP reply, dnsmasq hangs.
I thought first that just the TCP request was the problem so I tested doing the same query via TCP from another machine and it didn't crash it. I think the Netflix app isn't properly ending the stream - or at least it looks different - compare the following:
Broken (X is Xbox):
- X > pi [SYN]
- pi > X [SYN, ACK]
- X > pi [ACK]
- X > pi Standard query A api-global.netflix.com
- pi > X [ACK]
- pi > X Standard query response
- X > pi [ACK]
When I did a similar query from another linux machine (X is linux machine) as dig @pi +tcp api-global.netflix.com it looks like this:
- X > pi [SYN]
- pi > X [SYN, ACK]
- X > pi [ACK]
- X > pi Standard query A api-global.netflix.com
- pi > X [ACK]
- pi > X Standard query response
- X > pi [ACK]
- X > pi [FIN, ACK]
- X > pi [FIN, ACK]
- pi > X [ACK]
I'm not sure if that matters or not, but it seemed like one of the only differences.
I also looked at the query before the TCP one, to see if there was something obvious about why it would change from UDP to TCP on the next query. The only thing I can tell is that in the "broken" case, the response is larger (647 bytes) - the answer section seems to show the entire hostname in the Hex view of the packet, while the "working" case it seems to be some kind of abbreviated response (281 bytes total) but the info showin in Wireshark is identical as far as the server names and addresses.