Is there a python-module that\'s doing the same stuff as nslookup does? I am planning to use nslookup on digging some information regarding the domain of a URL to be scrappe
$ sudo apt install python-dns
$ python
>>> import DNS
>>> d = DNS.DnsRequest(server="1.1.1.1", timeout=1)
>>> r = d.req(name="stackoverflow.com", qtype="A")
>>> [i['data'] for i in r.answers]
['151.101.129.69', '151.101.193.69', '151.101.1.69', '151.101.65.69']
Further details like ttl can also be accessed, plus this approach has the advantage of letting you specify which nameserver to use, instead of just using your system's default.