Skip to content

Instantly share code, notes, and snippets.

View itdaniher's full-sized avatar

itdaniher itdaniher

  • mosslandia
View GitHub Profile
@itdaniher
itdaniher / dns.py
Created January 23, 2018 19:03 — forked from infra-0-0/dns.py
python3.5 asyncio dns resolver, based on code from who knows where
import os
import socket
import struct
import asyncio
import logging
DNS_SERVER = '8.8.8.8'
DNS_PORT = 53
def encode_header(packet_id):