usr bin php php Modify this array to include all the domains you wish

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/php
<?php
// Modify this array to include all the domains you wish to update
// array keys are the domain name, array values are the password you setup for dynamic updates
$domains = array(
'exapmle.com' => 'dayacode',
'www.exapmle.com' => 'macode');
$host = "dyndns.editdns.net";
$port = 80;
/* check for command-line options
if ($argc != 2 || in_array($argv[1], array('--help', '-help', '-h',
'-?')))
{ */
// setup syslogging
define_syslog_variables();
openlog("EditDNS", LOG_PID, LOG_LOCAL0);
// get the IP addres of the EditDNS server
$hostip = gethostbyname($host);
syslog(LOG_INFO,"Started EditDNS.net update...");
// loop through the domains, sending an update request for each one to the EditDNS server
foreach ($domains as $domain => $password)
{
// define post data
$post = "p=$password&r=$domain";
$postlen = strlen($post);
$buffer = "POST /api/dynLinux.php HTTP/1.0\r\n";
$buffer .= "Host: $host:$port\r\n";
$buffer .= "User-Agent: PHP EditDNS Updater 0.1\r\n";
$buffer .= "Referer: http://www.editdns.net\r\n";
$buffer .= "Content-Type: application/x-www-form-urlencoded\r\n";
$buffer .= "Content-Length: $postlen\r\n\r\n";
$buffer .= "$post\n";
// create network socket
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
// connect the socket
if (socket_connect($socket, $hostip, $port))
{
socket_write($socket, $buffer, strlen($buffer));
socket_recv($socket, $recvbuffer, 1024, 0);
syslog(LOG_INFO, "Updated $domain. Returned: $recvbuffer");
socket_close($socket);
}
}
syslog(LOG_INFO,"Completed EditDNS.net update.");
closelog();
?>