I'm looking for a python replacement for nslookup.
Other sources have pointed me towards socket.getaddrinfo(). However, this does not seem to allow me to specify a server through which to resolve a hostname, which nslookup supports and I require.
C:\Users\Administrator>nslookup 10.0.11.6 coolserver
Server: coolserv.coolserver.com
Address: 10.0.1.1
Name: the-host-name-i-want.blah.com
Address: 10.0.11.6
It is a requirement that I be able to do the lookup through "coolserver". Is this something socket
or any other python library is capable of?
I'm aware that I can just call nslookup directly through subprocess.
EDIT:
As explained above, this is not a duplicate of python module for nslookup
To my knowledge, socket.getaddrinfo()
does not allow you to route the request through a server. I need to know "what does this server think my hostname is". Not "what is my local hostname".