I want to spoof all DNS requests with the IP address of my local machine.

However, running dnsspoof, all clients receive the real IP address and not the fake IP address of my host.

I know I can run dnsspoof using the -f option. But in this case, I just want to spoof all DNS requests with the same address of my local host.

Any ideas?

root@kali:~# dnsspoof -i wlan0
dnsspoof: listening on wlan0 [udp dst port 53 and not src] >  21993+ A? api-glb-bln.smoot.apple.com >  65045+ A? p09-keyvalueservice.fe.apple-dns.net >  29989+ A? clients1.google.com >  53500+ A? gateway.fe.apple-dns.net >  51772+ A? tv2.dk >  43764+ A? assets.adobedtm.com >  39396+ A? shared.tv2.dk >  45196+ A? tv2login.dk >  61943+ A? platform.twitter.com >  64740+ A? cdn.optimizely.com >  2942+ A? static.chartbeat.com

It seems that dnsspoof needs a hosts file in order to know what address to reply with for which hostnames. In your case, you want all requests to resolve to the same address. From the manpage of Dsniff dnsspoof:

-f hostsfile
          Specify  the  pathname  of  a  file in hosts(5) format. Only one
          hostname allowed per line (no aliases), although  hostnames  may
          contain wildcards (such as *.doubleclick.net).

Note that hostnames in the hosts file can contain wildcards to match multiple names in a single line. We can use this to match all hostnames with a wildcard. Create a hosts file with the following line: *

This will result in matching all hostnames to your address,

Note that even after doing this and running dnsspoof with the -f flag, you still may run into issues, as the real DNS reply may reach the victim before yours. Other answers may help with this issue. There are also other tools that may better suit your use case, such as DNSChef.

| improve this answer | |
  • How would I block all real DNS replies? – Shuzheng May 8 '18 at 9:27
  • @user111854 see the answer I linked – multithr3at3d May 8 '18 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.