Trying to receive response from 8.8.8.8 but cant receive it on windows

  python-3.x, scapy, windows

Hi I am trying to receive a response from the ip 8.8.8.8 by sending it a dns request packet. I am using Scapy to create the dns request packet. I run the same code on Ubuntu and windows virtual machine and am able to receive the response but cant receive a response on my host machine. I am running wireshark as well and its the same. It doesn’t show any replies from 8.8.8.8. The code is as follows:

from scapy.all import IP,DNS,DNSQR,UDP,send,sniff,show_interfaces, sr1,ICMP,Raw, sr

dns_req = IP(dst="8.8.8.8")/UDP(dport=53)/DNS(rd=1, qd=DNSQR(qname="www.google.com", qtype="ALL"))

answer = sr(dns_req)

print(answer[0][UDP][0])

Any suggestions are appreciated!

Source: Python-3x Questions

LEAVE A COMMENT