def send_udp(data, host, port):
 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
 sock.sendto(data, (host, port))
 (response, server) = sock.recvfrom(8192)
 sock.close()
 return response

def send_udp ( data , host , port ) : sock = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM ) sock . sendto ( data , ( host , port ) ) ( response , server ) = sock . recvfrom ( 8192 ) sock . close ( ) return response
helper function to send/receive dns udp request .