$ nslookup 192.168.85.242
runs for about 20 seconds and fails. Sending SIGINT (control-C) at any time during that 20 seconds causes the command to end instantly.
On the other hand, with Python 3.6.4:
$ python
Python 3.6.4 (default, Jan 26 2018, 08:18:54)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostbyaddr("192.168.85.242")
^C
Hitting control-C does nothing, the socket command seems determined not to give up.
My question is, why? And most importantly, if I'm looping through multiple IP addresses and I'd like my code to fail after, say 2 seconds, the standard ways of implementing a timeout (such as https://pypi.org/project/timeout-decorator/ and Timeout on a function call) won't work.