开发者

How can i do a dns txt record lookup in perl without using Net::DNS

开发者 https://www.devze.com 2023-01-27 06:31 出处:网络
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..

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!


  1. Which specific parts of Net::DNS are slow for you? You need to profile to find out.

  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消