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

    Join Date
    Jul 2003
    Posts
    24
    Rep Power
    0

    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.

    Code:
    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=192.168.0.20");
    How can I get this done?

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

    Join Date
    Apr 2009
    Posts
    2,233
    Rep Power
    1297
    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.
    https://metacpan.org/search?q=google
    Last edited by FishMonger; October 20th, 2018 at 10:59 AM.

IMN logo majestic logo threadwatch logo seochat tools logo