title: Python gethostby.name takes too long
body: <p>I am working on a network scanner that processes the output from zgrab2 for about 800 records. Each record has an IP and information for 7 ports. Each record is stored as a JSON/line in a separate file. The code performs some reverse DNS and DNS checks to verify the data as much as I can. To do so each record is processed using a combination of try-except blocks and the information needed is stored.</p>
  <p>Upon profiling my script that does the data processing and analysis I found that gethostbyname takes the most amount of time and is affecting the speed of the code. Attached below is a screenshot of the cProfile I did for my script.</p>
  <p>I am not sure why gethostbyname is taking so long. Is it because it is using my local DNS?</p>
  <p>I came across using Google Public DNS for name resolutions as a faster alternative but I am not sure how to go about this. Any guidance on this and why it is taking so much time will be appreciated. Thanks in advance.</p>
  <p><a href="https://i.stack.imgur.com/uogwD.png" rel="nofollow noreferrer">cProfile stats</a></p>