code-dumps/py/dns-lookup2.py

14 lines
366 B
Python
Raw Normal View History

2022-09-07 10:31:34 +08:00
import dns.resolver
results = dns.resolver.query('wordpress.com', 'A')
stringResults = []
for ip in results:
print(ip.to_text())
stringResults.append(ip.to_text())
dummyList = ['192.0.78.9', '192.0.78.17', '2.3.4.5']
def diff(li1, li2):
return (list(list(set(li1)-set(li2)) + list(set(li2)-set(li1))))
print('Diff results: ', diff(stringResults,dummyList))