DyndnsCheckIP slow
-
Hi,
dyndnsCheckIP funtion uses http://checkip.dyndns.org to check the external IP and that url is very used and slow.What about using something like:
#!/usr/bin/env perl use Net::DNS; $ifaceIP = $ARGV[0]; $res = new Net::DNS::Resolver( nameservers => [ '208.67.222.222', '208.67.220.220' ], srcaddr => $ifaceIP ); $reply = $res->query('myip.opendns.com', 'A'); if ($reply) { foreach $answer ($reply->answer) { print $answer->address; } }
Uses opendns dns query for myip.opendns.com and will reply with my ip, very fast.
regards azurata
-
It could be made an option to choose which "what is my IP" site to use for these sort of checks - with a list of decent options for the user to choose from.
-
Yes that would be good, choosing the site for "what is my IP" would be good, and open to potentially use private sites setup for the job.
Nevertheless this Opendns feature 'myip.opendns.com' is very clever. They use a fast service used to discover IPs and respond with the requester IP.