You are not logged in.
I have a a domain with RegisterFly.com and a dynamic IP address. Thier site says to do this:
* Enable Dynamic DNS, you can access it within the domain manager.
* Make sure the domain is using our default nameservers
* Choose a Dynamic DNS application listed below under Dynamic DNS applications and install it OR you can type in the correct URL in your browser to update the domains IP.
* The parameters are as follows(they are case sensitive)
domain==>Your Domain Name
host==>The host name(e.g. www, mysite, secure)
password==>The Dynamic DNS password you are assigned below
ipaddress==>The IP Address is optional, if you don't specify an IP, the IP from which you are accessing the URL will be used for the domain
* URL to use
http://dynamic.registerfly.com?domain=domain.com&password=password&host=icq&ipaddress=1.1.1.1.1
* Configure the application to use your domain name, its password, and point it to our update server above: dynamic.registerfly.com
The "DNS applications listed below" are:
No, RegisterFly does not provide a client however we have included links to a number of good software clients you can use.
Linux
FlyIP ClientUnix
IPCheckOther
Java Dynamic DNS Client
IPCheck for OS/2
This is basically what I used to do with my DynDns.net account . . . point the registerfly dns entry to whatever.dyndns.net and update my dyndns account via thier client or other supported one. Then requesting mydomain.net would be redirected to mydomain.dyndns.org with or without mydomain.dyndns.org in the address bar depending on the cloaking setting.
This seems a little rediculous though. It is a an ugly hack in my opinion and I don't want to have to deal with domain forwarding and cloaking and all that nonsense.
Registerfly does offer the
http://dynamic.registerfly.com?domain=domain.com&password=password&host=icq&ipaddress=1.1.1.1.1
solution so I tried to write a script to fill in the real info for me and go to that URL.
I can't get it to work so maybe someone who is a lot better at this sort of thing might get a kick at just doing it for me? :oops:
It could be like a little competition. Which Archer can write the best solution.
Offline
I have a somewhat similar setup, which I spelled out in a wiki page..
http://wiki2.archlinux.org/index.php/Zo … namic%20IP
I just use a cron job for it...
if it does not detect your ip based on the request client (ie automatically), and you have to specify it..then you could just use
*/30 * * * * wget -O - http://dynamic.registerfly.com?domain=domain.com&password=password&host=icq&ipaddress=`wget -q http://whatismyip.com -O - | grep "ip is" | awk -F ' ' '{print $4}'` >>/dev/null 2>&1
EDIT: or...the following might be better vs a changing format of the whatismyip.com website..
*/30 * * * * wget -O - http://dynamic.registerfly.com?domain=domain.com&password=password&host=icq&ipaddress=`wget -q http://whatismyip.com -O - | grep -m1 -Eo "<[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}>"` >>/dev/null 2>&1
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Wow. wget is very versitile. I have zero experience with awk, but I will work with it for a bit.
Thanks.
Offline
*points at second solution in above post*
Do i get a banana?
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
I can't get this working with PHP.
$status = system("wget -O - http://dynamic.registerfly.com?domain=$domain&password=$password&host=$host&ipaddress=$ip_address", $status);
I tried system, exec, escapeshellcmd, . . .
I think something with the ampersands is messing this up.
Offline
I fixed the problem. How do I know if the change was successful?
Here is the html source for a good update:
<center>
<table border="0" cellspacing="0" width="100%" bgcolor="#FF0000" cellpadding="2">
<tr>
<td width="100%">
<div align="center">
<table border="0" cellspacing="0" width="100%" cellpadding="3" bgcolor="#FFFFFF">
<tr>
<td width="100%" class="text" align="center"><strong><b>Your Dynamic DNS change was accepted by our system</b></strong></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</center>
<br>
I know that I can grep for "change was accepted". All I can think of is
if (grep != "")
or something like that. I don't know sed, awk or any of those nifty commands.
Offline
oh..well...
if you are doing it in php, that is a different story altogether..
I assumed you were doing it via a cron or something..Doesnt make much sense to do it via php, as if you cannot access the site..then you cannot execute the php script..to change the ip..to load the site...
*shrug*
anyway, I am game..
$myiphtml = file_get_contents("http://whatismyip.com");
if (preg_match("/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}/", $myiphtml, $regs)) {
$ip_address = $regs[0];
} else {
die("Pfffttt...no ip address found"); //fail noisily
}
$httpfile = file_get_contents("http://dynamic.registerfly.com?domain=$domain&password=$password&host=$host&ipaddress=$ip_address");
if (!strstr($httpfile, "change was accepted")) {
die("You failed! Try again! Update did not occur"); //fail noisily
} else {
echo "go on your merry way, update worked ok";
}
"Be conservative in what you send; be liberal in what you accept." -- Postel's Law
"tacos" -- Cactus' Law
"t̥͍͎̪̪͗a̴̻̩͈͚ͨc̠o̩̙͈ͫͅs͙͎̙͊ ͔͇̫̜t͎̳̀a̜̞̗ͩc̗͍͚o̲̯̿s̖̣̤̙͌ ̖̜̈ț̰̫͓ạ̪͖̳c̲͎͕̰̯̃̈o͉ͅs̪ͪ ̜̻̖̜͕" -- -̖͚̫̙̓-̺̠͇ͤ̃ ̜̪̜ͯZ͔̗̭̞ͪA̝͈̙͖̩L͉̠̺͓G̙̞̦͖O̳̗͍
Offline
Version 0.1 I guess, it is pretty verbose
<?php
$domain='domain.tld';
$password='password';
$host='www';
$ip_address='000.000.000.000';
echo "Retrieving IP . . . n";
$ip_in_html = file_get_contents("http://whatismyip.com");
if (!$ip_in_html)
{
die ('Could not retrive IP address information');
}
$num="(*|[0-9]{1,3}|^1?dd$|2[0-4]d|25[0-5])";
if (preg_match("/$num.$num.$num.$num/",$ip_in_html,$matches))
{
print_r ($matches);
$ip_address = $matches[0];
}
else
{
die ('Could not determine IP address');
}
echo "Using domain : ", $domain, "n";
echo "Using password: ", $password, "n";
echo "Using host : ", $host, "n" ;
echo "Using address : ", $ip_address, "n" ;
echo "Updating Registerfly account . . . n";
echo "http://dynamic.registerfly.com?domain=$domain&password=$password&host=$host&ipaddress=$ip_addressn";
$status_html = file_get_contents("http://dynamic.registerfly.com?domain=$domain&password=$ppassword&host=$host&ipaddress=$ip_address");
if (strstr($status_html, 'change was accepted'))
{
echo ('Update successful');
}
elseif (strstr($status_html, 'The domain name was NOT specified'))
{
die ('Update failed: The domain name was NOT specified');
}
elseif (strstr($status_html, 'The password for this domain was not specified'))
{
die ('Update failed: The password for this domain was not specified');
}
else
{
die ("Update failed from unknown error:n$status_html");
}
?>
EDIT: POSSIBLE CHANGES
support multiple hosts
support multiple domains
for bulk updates
Offline