from scapy.layers.dns import DNS, DNSQR

def extract_dns_records(packets):
    records = []
    for pkt in packets:
        if pkt.haslayer(DNS) and pkt.haslayer(DNSQR):
            records.append(pkt[DNSQR].qname.decode(errors="ignore"))
    return list(set(records))
