Skip to content

MicroPython DNS Client - Pycom compatible

Notifications You must be signed in to change notification settings

insighio/DNS-Client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DNS-Client

MicroPython library for querying DNS records.

Tested on Pycom GPy module.

example IPv4:

import usocket
from query import dns_resolve

socket = usocket.socket(usocket.AF_INET, usocket.SOCK_DGRAM)

url='google.com'
dns_server="8.8.8.8"
ipv6 = False

resolvedIPs = dns_resolve(socket, url, dns_server, ipv6)
print("Resolved IP list: " + str(resolvedIPs))

socket.close()

example IPv6

import usocket
from query import dns_resolve

socket = usocket.socket(usocket.AF_INET, usocket.SOCK_DGRAM)

url='google.com'
dns_server="2001:4860:4860::8888"
ipv6 = True

resolvedIPs = dns_resolve(socket, url, dns_server, ipv6)
print("Resolved IP list: " + str(resolvedIPs))

socket.close()

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%