Checking for specific output from Python's DNS Resolver Query -


i'm trying write ask users input specific domain (say, google.com), , if _spf.google.com in spf txt record google.com, want "yup". if not, want "nope." right now, code ask me domain, , it'll spf record, can't "yup." why not? i've tried turning string, wouldn't me wanted. doing wrong here?

to add that, guys recommend jumping off point figuring out code i'd need write figure out how many dns lookups spf record using?

    import dns.resolver       question= raw_input("what domain want? ")      def printandgoogle(question):        answer=dns.resolver.query(question,"txt")       data in answer:         print data         if "_spf.google.com" in answer:           print "yup."         else:           print "nope."      printandgoogle(question) 

if if inside loop:

    if "_spf.google.com" in data.to_text(): 

if if outside loop:

if any("_spf.google.com" in data.to_text() data in answer): 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -