You are not logged in.
Does Webfaction support dynamic dns? Our domain, edmstudio.com is hosted with webfaction. Back here at the office, we are on broadband with a dhcp-allocated ip. What we'd like is for traffic to office.edmstudio.com to be routed to this ip. If it is possible, could someone please give some brief instructions about how to go about this? ( In terms of notification, our Linksys router only lists dyndns.org and tzo.com in its DDNS section. Likely then we'd have to get one of our internal Linux boxes to notifiy the outside of ip changes.) Any advice is much appreciated.
Cheers,
Darran.
Offline
futnuh wrote:
Does Webfaction support dynamic dns? Our domain, edmstudio.com is hosted with webfaction. Back here at the office, we are on broadband with a dhcp-allocated ip. What we'd like is for traffic to office.edmstudio.com to be routed to this ip. If it is possible, could someone please give some brief instructions about how to go about this? ( In terms of notification, our Linksys router only lists dyndns.org and tzo.com in its DDNS section. Likely then we'd have to get one of our internal Linux boxes to notifiy the outside of ip changes.) Any advice is much appreciated.
Cheers,
Darran.
Right now you can only change the IP address that your domains or subdomains point to through the control panel.
We can add an API method for this if that makes it easier for you ? Would you be able to run a script every time your IP changes to call the API and change the IP address on our system ?
Cheers,
Remi.
Offline
Yes, please, an api method for this would be wonderful. I can run a script when the ip changes ...
Offline
futnuh wrote:
Yes, please, an api method for this would be wonderful. I can run a script when the ip changes ...
OK. Give us 2 or 3 days ... It's new year's eve after all ![]()
Cheers,
Remi.
Offline
Great, thanks. Re New Years Eve comment, we're working towards a 10 January deadline so no holidays here. (Just in case that last comment comes across as a snipe, the DDNS issue is tangential - it has no impact on our deadline whatsoever ;-)
Offline
We've added 2 new API methods with the following signature:
create_dns_override(session_id, domain, a_ip='', cname='', mx_name='', mx_priority='', spf_record='')
and
delete_dns_override(session_id, domain, a_ip='', cname='', mx_name='', mx_priority='', spf_record='')
Here is a sample usage:
>>> import xmlrpclib
>>> server = xmlrpclib.ServerProxy('https://api.webfaction.com/')
>>> session_id, account = server.login('test5', 'password')
>>> server.create_dns_override(session_id, 'mytestdomain.com', '168.0.0.1', '', '', '', 'v=spf1 a:mail1.webfaction.com ?all')
{'domain': 'mytestdomain.com', 'a_ip': '168.0.0.1', 'spf_record': 'v=spf1 a:mail1.webfaction.com ?all', 'mx_name': '', 'cname': '', 'mx_priority': '', 'id': 303}
>>> server.delete_dns_override(session_id, 'mytestdomain.com')
[{'domain': 'mytestdomain.com', 'a_ip': '168.0.0.1', 'spf_record': 'v=spf1 a:mail1.webfaction.com ?all', 'mx_name': '', 'cname': '', 'mx_priority': '', 'id': 303}]
>>>Hope this helps.
Cheers,
Remi.
Offline
I found a bug on that api call, if you add the same override twice it goes in.
Offline
mae wrote:
I found a bug on that api call, if you add the same override twice it goes in.
Well, it's rather a "feature" ![]()
It allows you to do DNS load-balancing between 2 or more IP addresses...
Is it causing problems for you?
Cheers,
Remi.
Offline
Round robin is nice. I think it should be up to the software rather than the API (though I can see where this would cause confusion) to do this.
Offline
Hi there, this appears to be just what I'm looking for!
Is this API only available to Python, or could I use it in PHP too? I assume I probably can with the XMLRPCLib?
(Also, Remi, your post count is 666!!)
Offline
> Is this API only available to Python, or could I use it in PHP too? I assume I probably can with the XMLRPCLib?
The API is available via XMLRPC, so any language that can use that protocol can use the API.
Regards,
~Chris Sebastian
Offline
Thanks, likebike, I figured that would be the case! Now to experiment with it and see how I go ![]()
EDIT: I'm trying to work out how to use XMLRPC with PHP, but not having much luck so far... if anyone can give me some pointers, that'd be awesome!
EDIT: Nevermind! What was I thinking... PHP?! Not really the best technology to use for this. I've setup a Python script on a cron, and it appears to be working perfectly! Thanks heaps!
Last edited by japheth (2008-10-08 12:37:14)
Offline
I tried this, and it seems to take a while before the it works when I update the ip, is it normal ?
Offline
It might take a couple minutes for our nameserver configuration to get updated.
After that, the new DNS info needs to propagate through the entire internet. That could take a long while (hours), depending on where you are.
If you need the DNS propagation to occur quickly, you can lower the DNS TTL to 5 minutes. This way, the Doman's IP is refreshed every 5 minutes instead of once per hour (the default).
To lower the DNS TTL, just open a support ticket and tell us you need it lowered, and for which domains. Please explain to us that you want the low TTL to be permanent, and that it is for dynamic DNS. Otherwise, we'll probably raise it again after a few weeks.
Regards,
Christopher S.
WebFaction Support
Last edited by likebike (2009-02-04 09:51:07)
Offline
Thanks, will do, for those interested, here is my update script :
import urllib2
import xmlrpclib
import os
currentip = urllib2.urlopen('http://whatismyip.org').read()
if not os.path.isfile('lastip'):
f = open('lastip', 'w')
f.close()
with open('lastip', 'r') as f:
lastip = f.read()
if lastip != currentip:
server = xmlrpclib.ServerProxy('https://api.webfaction.com/')
session_id, account = server.login('username', 'password')
server.delete_dns_override(session_id, 'subdomain.domain.com')
server.create_dns_override(session_id, 'subdomain.domain.com', currentip, '', '', '', '')
with open('lastip', 'w') as f:
f.write(currentip)
print('IP updated to %s' % currentip)
else:
print('IP not updated')Offline
Another small question, if we ask to update the dns TTL, will it be global for a domain, or do we need to do it individually for each subdomain ?
Thanks,
Nat
Offline
You only need to request a low TTL once per domain. All subdomains will receive the same TTL as the domain that they come from.
Christopher S.
Offline
Wow, it would be really neat if that script would be invoked by launchd, on the event of an IP address.
If the machine would happen to be offline, it would be great to be able to fwd. the page to a sorry-we're-offline page...
http://meinit.nl/using-dyndns-iphone-os … ab-launchd
Offline