Created
November 21, 2017 03:36
-
-
Save MelindaShore/0230d7f78446d333b239d84f5f2feb46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import getdns | |
u = [ { 'address_data': '9.9.9.9', 'address_type': 'IPv4', } ] # TLS-capable public DNS resolver | |
c = getdns.Context() | |
c.resolution_type = getdns.RESOLUTION_STUB # these three lines are all the setup | |
c.dns_transport_list = [ getdns.TRANSPORT_TLS ] # needed to execute a query over TLS | |
c.upstream_recursive_servers = u | |
r = c.address('getdnsapi.net') | |
if r.status == getdns.RESPSTATUS_GOOD: | |
for a in r.just_address_answers: | |
print(a['address_data']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment