gethostbyaddr function is too slow (Perl socket programming) -


i'm trying run example in website tutorialspoint

but it's slow. thought had buffering response changing print syswrite did nothing added debugging messages , found out function gethostbyaddr takes around 10 seconds resolve.

i know there other modules socket programming wondering if problem common.

i running on localhost , using mac

of course can slow. contacts other machines lookup dns entry. (specifically, looking host address w.x.y.z looks ptr entry z.y.x.w.in-addr.arpa.) if authoritative dns server unresponsive, you're machine waiting response never come until machine has decided it's waited long enough.

if find gethostbyaddr slow, don't use it. work ip address. it's not gethostbyaddr useful. 216.58.219.46 has names lax17s04-in-f14.1e100.net , lax17s04-in-f46.1e100.net, know better google.com. , there's 209.85.250.97 gethostbyaddr returns no names, no matter how many domain names resolve 209.85.250.97.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -