aio-libs / aiodns

Simple DNS resolver for asyncio
https://pypi.python.org/pypi/aiodns
MIT License
538 stars 69 forks source link

Add support for getaddrinfo #118

Closed bdraco closed 7 months ago

bdraco commented 7 months ago

The end goal is to be able to use this in aiohttp's resolver https://github.com/aio-libs/aiohttp/blob/aa014a9c1084368a01a79f09bb238486e0aa164a/aiohttp/resolver.py#L91 as the current implementation doesn't return both IPv6 and IPv4 addresses which provides different semantics than the threaded resolver which uses python's built-in getaddrinfo

fixes #23 https://github.com/saghul/aiodns/issues/23#issuecomment-1055456917

We are going to be rolling out Happy Eyeballs support in aiohttp 3.10.x so it would be nice to be able to avoid the threads

saghul commented 7 months ago

The CI is not happy 😅

bdraco commented 7 months ago

Sorry about that. Should be ok now

bdraco commented 7 months ago

Looks like macos can return more than one address so I adjusted the test as well.

I created a fork, enabled actions, and verified a clean run https://github.com/bdraco/aiodns/pull/1

saghul commented 7 months ago

Cheers!

saghul commented 7 months ago

I'll cut a release tonight.

bdraco commented 7 months ago

Thanks

bdraco commented 7 months ago

I just finished the testing for a PR to aiohttp to use this and everything is working great.

Looks like we need getnameinfo as well and since pycares already has its, I'll open a PR in a bit for that one as well