Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: Dynamic DNS
PostPosted: Wed Nov 07, 2012 4:13 pm 
Offline
Newbie

Joined: Wed Nov 07, 2012 3:00 pm
Posts: 3
Website: http://radar.com.hr
Location: Karlovac, Croatia
Has someone managed to update Linode's DNS using DD-WRT router software?

As I have found out, URL request should be as follows:
https://api.linode.com/?api_key=<API_KEY>&api_action=domain.resource.update&DomainID=<DOMAIN_ID>&ResourceID=<RESOURCE_ID>&Target=<DYNAMIC_IP>

It's working when I try to update my IP using browser's address field, but I can't find out how to make it work using my router where there are standard fields:
* Server
* User Name
* Password
* Host Name
* URL

Any help appreciated.


Top
   
 Post subject: Re: Dynamic DNS
PostPosted: Wed Nov 07, 2012 4:18 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
You just need something that can make a web request. Doesn't need to be your router.

http://www.linode.com/api/dns/domain.resource.update

If you send the literal string [remote_addr] for the value of the target, our end will substitute it with the requester's IP. No need to scrape your local IP from the router or whatever...

Hope that helps,
-Chris


Top
   
 Post subject: Re: Dynamic DNS
PostPosted: Wed Nov 07, 2012 4:24 pm 
Offline
Newbie

Joined: Wed Nov 07, 2012 3:00 pm
Posts: 3
Website: http://radar.com.hr
Location: Karlovac, Croatia
Thanks, Chris, that will make my task easier!


Top
   
 Post subject: Re: Dynamic DNS
PostPosted: Wed Nov 07, 2012 4:41 pm 
Offline
Newbie

Joined: Wed Nov 07, 2012 3:00 pm
Posts: 3
Website: http://radar.com.hr
Location: Karlovac, Croatia
By the way, are there some reasonable limits regarding the regularity of sending such requests? For example, if I set that line to cron to be executed every half hour, is it too often?


Top
   
 Post subject: Re: Dynamic DNS
PostPosted: Wed Nov 07, 2012 4:43 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
Changed zones are only published every quarter hour. I think making your API call every 30 or 60 minutes is perfectly acceptable. Thanks for asking :)

-Chris


Top
   
 Post subject: Re: Dynamic DNS
PostPosted: Wed Nov 07, 2012 6:12 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
My approach is to run my script much more frequently (once a minute, I think, might have been once per 5 minutes), but only send a linode API query if the IP has changed, which is pretty rare. For IP change tracking I have my home file server (the thing getting the dynamic IP) call a PHP script on my linode that simply returns the IP of the person accessing the script:

http://fixppp.org/ip.php

The script is basically just like <?php print $_SERVER['REMOTE_ADDR']; ?> or something.

It required more effort to implement than just a simple linode API call every 30 minutes (which is a single API call), but it lets me get updates much quicker while simultaneously accessing the linode API much less frequently.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group