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!

1 Reply

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:

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.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct