Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added example script for updating your dynamic ip.
- Loading branch information
1 parent
b8fff5b
commit 2d5ebb8
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
/** | ||
* For updating a record with your dynamic ip. | ||
* Run with command: php -f dyndns.php | ||
*/ | ||
include('lib/gratisdns.php'); | ||
|
||
$username = 'your-login'; | ||
$password = 'your-password'; | ||
|
||
$domain = 'test123.dk'; | ||
$host = 'home.test123.dk'; | ||
|
||
$ip = file_get_contents('http://whatismyip.org/'); | ||
|
||
$dns = new GratisDNS($username, $password); | ||
$record = $dns->getRecordByDomain($domain, 'A', $host); | ||
$dns->updateRecord($domain, $record['recordid'], 'A', $host, $ip, 4800); |