I'm attempting to poison my dns cache on a virtual machine; however, I cannot get the machine to accept my fake dns responses. The virtual machine is running on linux. I added the following rule to the nat iptable
iptables -t nat -A OUTPUT -p udp -s 0/0 --sport 1024:65535 -d 0/0 --dport 53 -j DNAT --to 127.0.0.1:12345
when i run dig google.com the dns packet will get looped back to the machine but onto port 12345 where i am running a python/scapy script. that script reads the packet and forges a response with the correct port number and transaction id and sends it back to the machine on port 53. while using wireshark, everything looks correct, but when i run the dig command, the machine just repeatably requests a lookup and ignores my responses and says ";; connection timed out; no servers could be reached
". is there something i am forgetting? at first i thought it was because i originally was not setting the "Non-authenticated data" bit, but after setting that it still ignores the packets.
iptables -t nat -A OUTPUT -p udp -s 0/0 --sport 1024:65535 -d 0/0 --dport 53 -j DNAT --to 127.0.0.1:12345
when i run dig google.com the dns packet will get looped back to the machine but onto port 12345 where i am running a python/scapy script. that script reads the packet and forges a response with the correct port number and transaction id and sends it back to the machine on port 53. while using wireshark, everything looks correct, but when i run the dig command, the machine just repeatably requests a lookup and ignores my responses and says ";; connection timed out; no servers could be reached
". is there something i am forgetting? at first i thought it was because i originally was not setting the "Non-authenticated data" bit, but after setting that it still ignores the packets.