I'm trying to write a fast servi开发者_开发百科ce which requires dns txt lookups, i don't want to use any slow modules like Net::DNS..
Thanks for any tips!
Which specific parts of Net::DNS are slow for you? You need to profile to find out.
To do a lookup, you need to implement DNS query and parse the response.
For this second one, please use the following resources as reference:
- DNS client in C
- DNS query message format
- DNS response message format
- RFC 1035
If you're writing a service, I'd consider writing it using mod_perl or a similar technique. That way the slow parts of loading Net::DNS
could be processed in the startup section of your service and the actual queries would be fast.
As the previous reply already states, the key is to understand what is slow. perl -d:DProf
and then analyzing the output with dprofpp is probably a good idea in this case.
精彩评论