Search code examples
pythondnstwisted

Does Twisted cache DNS lookups? Does it honour TTL?


If I use the Twisted Endpoint API to make a series of connections to the same host, will Twisted cache the DNS lookup between requests?

If it does, will it honour the DNS record's TTL?

My implementation is fairly vanilla. I instantiate a SSL4ClientEndpoint with host, port etc, and through the life of the program I use it to make several connections.


Solution

  • I think Twisted simply uses the OS' resolver, so the answer to both questions is "as much as your OS does".