Coder Social home page Coder Social logo

rouralberto / alicloud-php-dns-updater Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 21.0 21 KB

PHP7+ DNS updater for Alibaba Cloud/Alicloud/Aliyun/Alidns

Home Page: https://albertoroura.com/dynamic-dns-using-alibaba-cloud-dns-api/

License: GNU General Public License v3.0

PHP 100.00%
aliyun alibabacloud alicloud php dynamicdns dns dns-record updaterecord api

alicloud-php-dns-updater's Introduction

Alicloud PHP DNS Updater

PHP DNS auto-updater for Alicloud/Aliyun/Alidns. The script uses the Alicloud API to update a domains DNS. This script can be automated in a cron job to easily keep up to date the target IP in a given domain.

Code is meant to run on PHP 7.0+

Example

<?php

date_default_timezone_set('UTC');

include_once 'alicloud-php-updaterecord/V20150109/AlicloudUpdateRecord.php';

use Roura\Alicloud\V20150109\AlicloudUpdateRecord;

$AccessKeyId     = 'ACCESS_KEY_ID';
$AccessKeySecret = 'ACCESS_KEY_SECRET';
$updater         = new AlicloudUpdateRecord($AccessKeyId, $AccessKeySecret);

$newIp = '<NEW_IP_GOES_HERE>;

$updater->setDomainName('<DOMAIN_NAME_HERE>');
$updater->setRecordType('A');
$updater->setRR('@');
$updater->setValue($newIp);

print_r($updater->sendRequest());

alicloud-php-dns-updater's People

Contributors

rouralberto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

alicloud-php-dns-updater's Issues

random_int() expects parameter 2 to be int

While running this on my local machine I found this error in the error log file.

[Tue Sep 29 21:20:21.908468 2020] [php7:error] [pid 13717] [client ::1:54442] PHP Fatal error: Uncaught TypeError: random_int() expects parameter 2 to be int, float given in /var/www/html/dyndns-updater/alicloud-php-updaterecord/V20150109/AlicloudUpdateRecord.php:228\nStack trace:\n#0 /var/www/html/dyndns-updater/alicloud-php-updaterecord/V20150109/AlicloudUpdateRecord.php(100): random_int(1000000000, 9999999999)\n#1 /var/www/html/dyndns-updater/index.php(20): Roura\Alicloud\V20150109\AlicloudUpdateRecord->sendRequest()\n#2 {main}\n thrown in /var/www/html/dyndns-updater/alicloud-php-updaterecord/V20150109/AlicloudUpdateRecord.php on line 100

if RR record more then 20 get error RR not found.

add 'RRKeyWord' => $this->rR, then work fine

public function getRecordId(): string
{
    $queries = [
        'AccessKeyId' => $this->accessKeyId,
        'Action' => 'DescribeDomainRecords',
        'DomainName' => $this->domainName,
        
		
        'Format' => 'json',
		'RRKeyWord' => $this->rR,

new issue

i try your code get this =

Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/tripjek99/public_html/alidns/alicloud-php-updaterecord/V20150109/AlicloudUpdateRecord.php on line 62

how fix it?

Can support AAAA DNSR?

Is there any way to modify the AAAA DNSR of IPv6?
有没有办法修改IPv6的AAAA解析呢?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.