Linode Forum Index Linode Forum
Linode Community Forums
 


Automatically Create Subdomains

Click here to go to the original topic

 
       Linode Forum Index -> General Discussion
Author Message
jzumbrum



Joined: 16 Dec 2011
Posts: 2

Posted: Fri Dec 16, 2011 11:09 am    Post subject: 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.
Back to top  
hawk7000



Joined: 10 Dec 2010
Posts: 95

Posted: Fri Dec 16, 2011 11:17 am    Post subject: Re: Automatically Create Subdomains  

jzumbrum wrote: 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.
Back to top  
hybinet



Joined: 02 May 2008
Posts: 1058

Posted: Fri Dec 16, 2011 9:32 pm    Post subject:  

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.
Back to top  
jzumbrum



Joined: 16 Dec 2011
Posts: 2

Posted: Fri Dec 16, 2011 11:06 pm    Post subject: Re: Automatically Create Subdomains  

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:

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

Worked like a charm, and super easy. Thanks!
Back to top  
 
       Linode Forum Index -> General Discussion
Page 1 of 1