How do I perform a DNS leak test from the CLI?
Check this
tcpdump is the command you’re looking for, but DNS leaks will be more difficult to detect if they’re running over https. For that you’ll have to look at packet length, end points, frequency, and still tolerate false positives
Run dig
Will tell you your DNS server.
Simple.
Here’s an article and a tool from Julia Evans.
Someone developped a tool for that : GitHub - macvk/dnsleaktest: An open source script tests VPN connection for DNS Leak.