code-dumps/py/dns-lookup2.py

14 lines
366 B
Python
Raw Normal View History

2024-10-24 23:09:21 +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))