# gevent

# Name Resolution (DNS)

gevent includes support for a pluggable hostname resolution system. Pluggable resolvers are (generally) intended to be cooperative. This pluggable resolution system is used automatically when the system is `monkey patched`, and may be used manually through the `resolver attribute` of the `gevent.hub.Hub` or the corresponding methods in the `gevent.socket` module.

A resolver implements the 5 standandard functions from the `socket` module for resolving hostnames and addresses:

- `socket.gethostbyname()`

- `socket.gethostbyname_ex()`

- `socket.getaddrinfo()`

- `socket.gethostbyaddr()`

- `socket.getnameinfo()`

## Configuration

gevent includes four implementations of resolvers, and applications can provide their own implementation. By default, gevent uses `a threadpool`. This can `be customized`.

Please see the documentation for each resolver class to understand the relative performance and correctness tradeoffs.

- `gevent.resolver.thread` – thread based hostname resolver
- `gevent.resolver.ares` – c-ares based hostname resolver
- `gevent.resolver.dnspython` – Pure Python hostname resolver
- `gevent.resolver.blocking` – Non-cooperative resolver

Next page: `gevent.resolver.thread` – thread based hostname resolver