0

i'm trying to figure out, how i can do the dig command

dig ns example.com @8.8.8.8              # example

in dnspython..

what I already tried is this:

res = dns.resolver.Resolver()           # also tried with configure=False
res.nameservers = ['8.8.8.8']

answer = res.query('example.com', 'NS')  # this raises NoAnswer

thanks for your help!

Jonas Metzener
  • 133
  • 1
  • 8
  • Your python code works for me. Is your PC connected to the Internet? Does `dig` succeed on the same PC? Did **exactly** those three lines fail for you? – Robᵩ Apr 07 '14 at 17:19
  • yes. pc is connected, dig works, and python code without specific nameservers works all fine. – Jonas Metzener Apr 08 '14 at 07:01
  • Since the code the you've shared works correctly, perhaps the error is in the part you *didn't* share. Please post a short, complete program that demonstrates the error. See http://stackoverflow.com/help/mcve or http://SSCCE.org for more info. – Robᵩ Apr 08 '14 at 12:09

0 Answers0