LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-20-2019, 12:17 PM   #1
spayk
LQ Newbie
 
Registered: Jul 2018
Posts: 15

Rep: Reputation: Disabled
Zone/Sub-domains auto creation


Hello,
I would like to ask if there is any possibility to make automatic or almost automatic way to create zones/sub-domains?
For example. I have a hosting example.com
I am making a new application or anything other related. I would like to make on main machine test.example.com by 1 click - and so on, and so forth. I heard this is possible via htaccess but not sure.
Anyone had experience with that?

Last edited by spayk; 11-20-2019 at 12:20 PM.
 
Old 11-21-2019, 09:55 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by spayk View Post
Hello,
I would like to ask if there is any possibility to make automatic or almost automatic way to create zones/sub-domains?
For example. I have a hosting example.com
I am making a new application or anything other related. I would like to make on main machine test.example.com by 1 click - and so on, and so forth. I heard this is possible via htaccess but not sure.
Anyone had experience with that?
Yes. I have several sub-domains.
Sub-domains must first be defined/set up at the authoritative name server for the domain.
Then it will need to be set up in the config for the web server. I doubt that can be done in a .htacess file...

No, there’s no way to do that “automatically”.
 
Old 11-25-2019, 06:48 AM   #3
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Your request isn't clear if you actually need full subdomains defined

If you looking to create: test.domain.com and then have www.test.domain.com, ftp.test.domain.com, blah.test.domain.com and fully delegate DNS management to a separate zone?

You don't actually need a separate zone file in many cases as you can define hosts with any number of parts in normal DNS, you're just creating A records, infact if you only have one server/IP you can have a wildcard A record that allows anything.domain.com com to point at the same server and then sort it out with apache vhosts.

As for creating stuff automatically, well depending on your DNS provider you should certainly be able to create A records (etc.) programatically through either directly manipulating zone files if you're self hosting or APIs for many common DNS providers.

Clarify what you're actually trying to do and you'll get better answers.
 
Old 11-29-2019, 04:37 AM   #4
spayk
LQ Newbie
 
Registered: Jul 2018
Posts: 15

Original Poster
Rep: Reputation: Disabled
@scasey
I understand. Automatically answering to the post for TenTenths then I will give you a link for what I needed.
@TenTenths
Yeah, basically that's what you are saying. If I do have example.com then I would need a script or sth when I add name then I would get like you said test.example.com, ftp.test.example.com and so on.
I meant something like that:
https://inchoo.net/magento/how-to-se...ment-computer/
do you have more experience regardnig for that?
Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I find file zone in the slave zone to the do a transfer of zone from Windows Server 2012 as master dns and CentOS as slave DNS. To learn Linux - Newbie 1 09-02-2016 09:36 AM
Shell Script to compare folders,Sub-Folders and Sub-Sub-Folders unix_72427 Programming 8 08-08-2012 02:51 PM
Which zone bind dns work either in forward zone are reverse zone sanjay87 Linux - Server 2 06-05-2012 04:21 AM
Sub Domains & Multiple Domains (Apache) lugos Linux - Server 1 09-01-2006 10:22 PM
linux firewall with internet zone, dmz and trusted zone ikhwan98 Linux - Security 1 11-27-2001 04:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration