Automatically Create Subdomains

Hey All,

Is there some API or interface for me to automatically create subdomains using a script?

I've got creating virtual host records and restarting apache, but need to create DNS records. I think that's all that's left to make it happen. Any suggestions?

Thanks,

-Z.

4 Replies

@jzumbrum:

Hey All,

Is there some API or interface for me to automatically create subdomains using a script?

I've got creating virtual host records and restarting apache, but need to create DNS records. I think that's all that's left to make it happen. Any suggestions?

Thanks,

-Z.

If you are using the Linode DNS service: http://www.linode.com/api/

If you are using some other DNS solution you'll probably want to send dynamic updates, http://www.dnspython.org/ is an example of a good starting point for doing that in scripts.

If you only have a few subdomains and they don't change a lot, just create them manually.

If you have a lot, you could use the API as @hawk7000 suggested. Even simpler, you could just create a wildcard DNS record pointing to your server and forget about it.

Thanks for the help guys. I ended up using CURL like this since the php bindings were too complicated to figure out given the meager instructions:

$ch = curl_init(my_linode_url_with_get_params);
curl_exec($ch);
curl_close($ch);

Worked like a charm, and super easy. Thanks!

good day,

can you tell how did you manage to add subdomains using linode? a php scripts.

Thanks a lot.

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