#NEWLINE# def get_txt_pydns( name ) : #NEWLINE# #INDENT# 'Return a TXT record associated with a DNS name.' #NEWLINE# if name . endswith ( '.' ) : #NEWLINE# #INDENT# name = response [ : ( - 1 ) ] #NEWLINE# #UNINDENT# response = DNS . DnsRequest ( name , qtype = 'txt' ) . req ( ) #NEWLINE# if ( not response . answers ) : #NEWLINE# #INDENT# return None #NEWLINE# #UNINDENT# return b'' . join ( response . answers [ 0 ] [ 'data' ] )