I have setup a DNS server on a machine. I want to capture the DNS replies before the machine sends out, and change some fields in it and then send the packet.
I am only able to change fields in the packet my pcap code(written in C) captures, which seems like a copy, as the original packet is also transmitted.
I tried iptables to drop packets originating from the machine, but it drops the pcap injected packets as well.
Is there any way out of this?
thank you