LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Setting up a sub-domain (https://www.linuxquestions.org/questions/linux-networking-3/setting-up-a-sub-domain-300174/)

DPenguin 03-10-2005 06:53 PM

Setting up a sub-domain
 
Hello,

I am running fc3 on a gateway 7200x pc.
I have 1 domain setup on my system, and I want to create some sub-domains to separate my websites logically.

How do I configure my zone file to create the sub-domains?

My zone file looks like:
$ORIGIN .
$TTL 1d
foobar.com IN SOA foobar.com hostmaster.foobar.com. (
2005030301 ; serial
28800 ; refresh (8 hours)
7200 ; retry (2 hours)
3600000 ; expire (5 weeks 6 days 16 hours)
43200 ; minimum (12 hours)
)
NS ns1.foobar.com.
NS ns3.foobar.com.
MX 10 smtp.secureserver.net.
MX 20 mailstore.secureserver.net.
A 10.0.0.1
$ORIGIN foobar.com.
localhost A 127.0.0.1
oasis A 10.0.0.1
smtp A 10.0.0.1
mail A 10.0.0.1
www CNAME oasis.
ftp CNAME oasis.

obviously I have changed the ip address and domain name.

I want to add subdomains of test.foobar.com, and dev.foobar.com.

any suggestions greatly appreciated.

shubb 03-10-2005 07:08 PM

Let me see if I understand your request:

Do you want to have separate zones that can have their own hosts, like server1.test.foobar.com and server2.test.foobar.com, or do you want to just have a server that is test.foobar.com?

If you just want to have a server called test.foobar.com, then all you need to do is add a CNAME or an A record for the host.
Code:

test.foobar.com.      CNAME        realserver.foobar.com.
dev.foobar.com.        A          192.168.5.5

If you want to have whole sub-zones, then you need to add a new zone in the named.conf file.

Code:

zone "dev.foobar.com" {
      type master;
      file dev;
      };

Then, in the dev file, create the records for server1.dev.foobar.com, etc.

Does this answer your question?

DPenguin 03-10-2005 10:36 PM

sub-domains
 
Shubb,

What I want is to be able to configure my apache server to have virtual hosts of test.foobar.com and dev.foobar.com, and to have the proper dns entries to handle it.

I suspect that the second approach you outlined is what I really want, so I will give it a try.
Thanks

shubb 03-14-2005 01:23 PM

What you want to do is exactly what I am doing with my server.

If the same web server handles all the different virtual websites, then all you need to do is add the CNAME entry for all the different hosts into the zone file. Each of these points to the hostname that you have the A record for the real server. That is actually the first option I listed.

Code:

server.foobar.com.          A        192.168.1.1
www.foobar.com.            CNAME    server.foobar.com.
dev.foobar.com.            CNAME    server.foobar.com.



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