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