0

I want to add to my web app a reverse DNS lookup to check the authenticity of googlebot user agents, as google suggests in their webmasters tools. Is there any standard way of doing this asynchronously? I have not been able to find anything in the tornado docs. All I found was this Github project that lists reverse DNS as a future feature. Is there any way to avoid blocking for reverse DNS lookups?

Thanks

Taku
  • 31,927
  • 11
  • 74
  • 85
WeaselFox
  • 7,220
  • 8
  • 44
  • 75

1 Answers1

1

You can either call socket.gethostbyaddr in a ThreadPoolExecutor or use pycares (doing something like what's in tornado.platform.caresresolver' but forgethostbyaddrinstead ofgetaddrinfo`)

Ben Darnell
  • 21,844
  • 3
  • 29
  • 50