Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
module to do DNS queries
#1
i am looking for a module to do DNS queries. there seem to be many of them; more for Python2. where can i get a thorough description of each?

i need to do many queries in parallel, even if they end up being TCP queries. i'd prefer to not have a zillion processes or threads run just to do a zillion parallel queries. i vaguely remember browsing instructions to one such package a couple years ago and it was oriented at the idea that the caller used it to construct queries and explode replies while the caller did all the network sending and receiving. that kind of interface would be preferred.

any suggestions or ideas?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
you can create your own simply using:
Python 3.7.1 (default, Nov 20 2018, 18:13:14) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> socket.gethostbyname('python-forum.io')
'198.199.80.192'
>>>
you can add threading
Reply
#3
yeah, the actual network i/o is not hard. what i want to avoid is building and interpreting the DNS data records. i did mention that the one module i did see long ago let the caller do the network i/o (supposedly for cases of specialized network access or layering) and did construction and interpretation of the data. there was a function that you would pass a description of the request you wanted to make and it would return the data to send to the DNS server. there was another function that you would pass the reply you got from the DNS server and it work return a dictionary of a breakdown of that reply. i did not look to see, but supposedly the data would be a bytearray.

i would not need threading. i could send a bunch of DNS queries and work with the replies when they arrive back. maybe more would be sent as a result. then when the desired results had arrived the code could go to the final wait stage and wait until all replies are received or a timeout had run out.

one script i plan to do is a query that follows every NS record and queries every unique server to accumulate all possible answers for a given query and where they come from.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  module for DNS queries Skaperen 7 3,818 Jan-21-2018, 04:18 AM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020