Python - dig ANY equivalent with scapy module
Question: I want to use the python module scapy to perform an equivalent command of

    
    
    dig ANY google.com @8.8.4.4 +notcp
    

I've made a simple example code:

    
    
    from scapy.all import *
    
    a = sr(IP(dst="8.8.4.4")/UDP(sport=RandShort(),dport=53)/DNS(qd=DNSQR(qname="google.com",qtype="ALL",qclass="IN")))
    
    print str(a[0])
    

And it send and recieve a packet, but when I sniffed the packet the response
says `Server failure`.

[Wireshark Screenshot - scapy](http://i.stack.imgur.com/Ug2Al.png)

[Wireshark Screenshot - dig](http://i.stack.imgur.com/bt1sw.png)

Sniffing the `dig` command itself, looks nearly the same but it gives me a
correct response and also it does not send another `ICMP - Destination
unreachable` Packet.. this only comes up when sending it with scapy.

If you need more information, feel free to ask. Maybe someone can help me with
this..

**EDIT:**

Maybe the `ICMP - Destination unreachable` packet were send because `8.8.4.4`
tries to send the response to my `sport`, wich is closed? But why should `dig`
then work?!


Answer: Got the Python code working with scapy..

    
    
    srp(Ether()/IP(src="192.168.1.101",dst="8.8.8.8")/UDP(sport=RandShort(),dport=53)/DNS(rd=1,qd=DNSQR(qname="google.com",qtype="ALL",qclass="IN"),ar=DNSRROPT(rclass=3000)),timeout=1,verbose=0)
    

In Wireshark we can see now a correct response: [Wireshark
Screenshot](http://i.stack.imgur.com/UKtIq.png)

But I'm still getting the `ICMP - Destination unreachable` packet.. and I
don't know why..

