Dnsanon is a tool to extract DNS traffic from pcap to text with optionally anonymization.
see https://ant.isi.edu/software/dnsanon/