1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Rep Power

    Need help with updating DNS from Perl

    I have a working perl script that I hodge podged together and it is doing all that I need except for updating google DNS for me.

    I am using some system commands that are working. When I try to use the system command with curl it errors out sawing it cannot resolve the address.

    system("cp /var/failover/iax_custom.conf /etc/asterisk/iax_custom.conf");
    system ("curl https://host:password@domains.google.com/nic/update?hostname=myhostname&myip=");
    How can I get this done?

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Apr 2009
    Rep Power
    My suggestion would be to not use the system calls. Perl has modules to handle both of those system calls.

    File::Copy - Copy files or filehandles
    LWP - The World-Wide Web library for Perl

    If you really want to use curl, then use Perl's wrapper module.
    LWP::Curl - LWP methods implementation with Curl engine

    The modules will give you better control and error checking/handling.

    BTW, there are a number of google modules (which I have never used). You might find one of them is already designed to do what you need.
    Last edited by FishMonger; October 20th, 2018 at 09:59 AM.

IMN logo majestic logo threadwatch logo seochat tools logo