def writeMessage(self, message):
        """
        Send a message holding DNS queries.

        @type message: L{Message}
        """
        s = message.toStr()
        self.transport.write(struct.pack('!H', len(s)) + s)

        Send a message holding DNS queries.

        @type message: L{Message}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/dns.py