You are not logged in.

#1 2006-12-30 01:05:15

futnuh
Member
Registered: 2006-09-21
Posts: 13

dynamic dns?

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

 

#2 2006-12-30 10:44:32

remi
Member
From: London
Registered: 2006-09-19
Posts: 741
Website

Re: dynamic dns?

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.


WebFaction - Smarter web hosting

Offline

 

#3 2006-12-30 22:48:25

futnuh
Member
Registered: 2006-09-21
Posts: 13

Re: dynamic dns?

Yes, please, an api method for this would be wonderful.  I can run a script when the ip changes ...

Offline

 

#4 2006-12-31 13:18:23

remi
Member
From: London
Registered: 2006-09-19
Posts: 741
Website

Re: dynamic dns?

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 smile


Cheers,

Remi.


WebFaction - Smarter web hosting

Offline

 

#5 2007-01-01 00:37:34

futnuh
Member
Registered: 2006-09-21
Posts: 13

Re: dynamic dns?

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

 

#6 2007-01-02 17:30:56

remi
Member
From: London
Registered: 2006-09-19
Posts: 741
Website

Re: dynamic dns?

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:

Code:

>>> 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.


WebFaction - Smarter web hosting

Offline

 

#7 2007-01-02 21:22:33

futnuh
Member
Registered: 2006-09-21
Posts: 13

Re: dynamic dns?

Awesome, thanks Remi.

Offline

 

#8 2008-04-18 04:08:37

mae
Member
Registered: 2006-10-15
Posts: 445

Re: dynamic dns?

I found a bug on that api call, if you add the same override twice it goes in.

Offline

 

#9 2008-04-20 11:15:25

remi
Member
From: London
Registered: 2006-09-19
Posts: 741
Website

Re: dynamic dns?

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" smile
It allows you to do DNS load-balancing between 2 or more IP addresses...
Is it causing problems for you?

Cheers,

Remi.


WebFaction - Smarter web hosting

Offline

 

#10 2008-04-21 02:12:08

Techie-Micheal
Member
Registered: 2008-01-26
Posts: 57

Re: dynamic dns?

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

 

#11 2008-10-06 15:52:32

japheth
Member
From: Australia
Registered: 2008-08-13
Posts: 102

Re: dynamic dns?

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

 

#12 2008-10-07 11:03:12

likebike
Member
Registered: 2008-05-05
Posts: 263

Re: dynamic dns?

> 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

 

#13 2008-10-08 10:56:30

japheth
Member
From: Australia
Registered: 2008-08-13
Posts: 102

Re: dynamic dns?

Thanks, likebike, I figured that would be the case!  Now to experiment with it and see how I go  smile

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

 

#14 2009-02-04 09:07:07

natcl
Member
Registered: 2009-02-04
Posts: 7

Re: dynamic dns?

I tried this, and it seems to take a while before the it works when I update the ip, is it normal ?

Offline

 

#15 2009-02-04 09:49:58

likebike
Member
Registered: 2008-05-05
Posts: 263

Re: dynamic dns?

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

 

#16 2009-02-04 17:13:51

natcl
Member
Registered: 2009-02-04
Posts: 7

Re: dynamic dns?

Thanks, will do, for those interested, here is my update script :

Code:

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

 

#17 2009-02-04 17:19:44

natcl
Member
Registered: 2009-02-04
Posts: 7

Re: dynamic dns?

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

 

#18 2009-02-06 07:22:10

likebike
Member
Registered: 2008-05-05
Posts: 263

Re: dynamic dns?

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

 

#19 2009-02-06 07:23:39

natcl
Member
Registered: 2009-02-04
Posts: 7

Re: dynamic dns?

Thanks a lot !

Offline

 

#20 2010-07-07 15:51:58

jellef
Member
Registered: 2008-07-28
Posts: 9

Re: dynamic dns?

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

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson