Problem in spoofing srcip address dns.resolver.query

114 views
Skip to first unread message

PANKAJ RAWAT

unread,
Dec 11, 2012, 1:38:43 AM12/11/12
to dnspyt...@googlegroups.com
I am not able to spoof src ip address when querying DNS.

dns.resolver.query(domain,''A'',1,False,str(srcip))


The above API is taking to musch time and still not able to get the answer

Can any one help in this regard.?

Thanks
Pankaj Rawat

Bob Halley

unread,
Dec 11, 2012, 10:27:39 AM12/11/12
to dnspyt...@googlegroups.com
On Monday, December 10, 2012 10:38:43 PM UTC-8, PANKAJ RAWAT wrote:

I am not able to spoof src ip address when querying DNS.

dns.resolver.query(domain,''A'',1,False,str(srcip))


The above API is taking to musch time and still not able to get the answer

This is not going to work.  dnspython cannot spoof addresses.  When you specify a source address to use in dns.resolver.query(), that's telling dnspython to bind() its source address to the specified address.  This will only succeed if the specified address is associated with an interface on your system.  If the address isn't valid, then dns.query.udp() will throw an exception which dns.resolver.query() will catch and treat (wrongly) as a problem with the target server, and thus it will move on to the next server.  No queries will ever be sent, and dnspython will spin until the query timeout has occurred.

/Bob

Reply all
Reply to author
Forward
0 new messages