When you do a DNS request, which DNS server is used? This tool will tell you. It does a DNS request while doing a packet capture and gets the DNS server that replied.
Warning: Requires root access since it does a packet capture while doing the dns requests.
sudo ./whichdns
sudo ./whichdns --iponly
Needs pcap to build
dnf install libpcap-devel
apt install libpcap-dev
CGO_ENABLED=1 go build
Default interface: wlp4s0
2024/03/11 22:16:18 Making DNS requests
2024/03/11 22:16:18 DNS request made.
2024/03/11 22:16:18 DNS response from: 192.168.178.21
Contributions are always welcome! All contributions are required to follow the https://google.github.io/styleguide/go/
Please report any security vulnerabilities to the project using issues or directly to the owner.
This project follows the go project code of conduct, please refer to https://go.dev/conduct for more details
- add options to return just the dns server for use in scripts
I will always follow the Linux Kernel License as primary, if you require any other OPEN license please let me know and I will try to accomodate it.