saghul / aiodns

Simple DNS resolver for asyncio

Home Page:https://pypi.python.org/pypi/aiodns

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Requested hostname in response?

blark opened this issue · comments

Is it possible to get the requested hostname included in the response (error or success)?

When requesting lots of domain names at one time it becomes cumbersome to try and include this data in some other way. It would be great if it was just accessible in the returned object.

If I'm missing something please let me know, but right now I only see the TTL and IP address.

Actually, I just realized I could pass the info as a parameter to my callback using the following syntax:

task.add_done_callback(functools.partial(<FUNCTION_NAME>, <PARAMETER>))

Which works fine, but there may still be a case for including the request domain in the object for convenience sake?

Sorry this fell through the cracks. I'd rather keep the API as minimal as possible, so the partial the way to go :-)

Thanks for the response!