 |
Linode Forum Linode Community Forums
|
| Author |
Message |
zobrak
Joined: 26 Nov 2011
Posts: 14
|
| Posted: Tue Dec 06, 2011 1:45 pm Post subject: Adding domains to automagicly. Linode API or work around??? |
|
|
I have a customer that wants to buy and add the .info, .net, .biz etc. for their existing .com domains...
Now I built a site and pretty much washed my hands of the whole project, 1. because I'm not a web developer, i got the site up and running and 2. I didn't get paid nearly enough to make regular maintenance to the site.
In Linode is there a way, to automatically add sites into the DNS records? or a work around for having 100+ domains?
I know how to add multi-domins into the virtual hosts and get them running manually but the first steps are to add the domains into the DNS tab in the Linode Dashboard.
Thanks! |
|
| Back to top |
|
hoopycat
Joined: 30 Aug 2008
Posts: 1294
Location: Rochester, New York
|
| Posted: Tue Dec 06, 2011 3:58 pm Post subject: |
|
|
The API is probably the easiest way. You'd do a domain.create for the domain, then domain.resource.creates for the records within the domain. In Python, it's roughly:
Code: from api import Api
linode = Api(api_key)
for domain_name in mythical_domain_iterator():
d = linode.domain_create(domain=domain_name, type='master')
domain_id = d['DATA']['DomainID']
for name, rrtype, target in mythical_record_tuple_iterator():
linode.domain_resource_create(domainid=domain_id, type=rrtype, name=name, target=target)
Other languages may require semicolons. |
|
| Back to top |
|
| |
|