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. |
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. Code:
zone "dev.foobar.com" { Does this answer your question? |
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 |
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 |
All times are GMT -5. The time now is 02:19 PM. |