Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    DyndnsCheckIP slow

    Scheduled Pinned Locked Moved Development
    3 Posts 2 Posters 1.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      azurata
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • P
        phil.davis
        last edited by

        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.

        As the Greek philosopher Isosceles used to say, "There are 3 sides to every triangle."
        If I helped you, then help someone else - buy someone a gift from the INF catalog http://secure.inf.org/gifts/usd/

        1 Reply Last reply Reply Quote 0
        • A
          azurata
          last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.