PDA

View Full Version : A, MX, CNAME - How dya make a subdomain of a FQDN?



Lexxuk
07-09-03, 18:25
Ok, I got full control over A, CNAME and MX of a FQDN, say, www.i-sleep-with-dead-animals.com now, there are two ways of getting to this addy, Either www.i-host-sites.com/~deadanimals or directly through the URL.

Thru FTP, the site's index.html (or even shtml) is in /htdocs/ on the host.

Now, in /htdocs/ I make a few directories

/sheep
/droms
/hinch

Now, I dont want people to have to type in www.i-sleep-with-dead-animals.com/sheep I want them to be able to type in http://sheep.i-sleep-with-dead-animals.com (wish I'd gone for a shorter name now O_o )

I know I can set up MX and A for email, so I can collect it myself on my 2003 box, and I also know I can get my host to map cgi.i-host-sites.com/~sites to cgi.i-sleep-with-dead-animals.com.

So, how do I get to make....

www.i-sleep-.../sheep : sheep.i-sleep....com
www.i-sleep...com/droms : droms.i-sleep...com
www.i-sleep...com/hinch : hinch.i-sleep...com

Using MX/A/CNAME/.htaccess/act of god :p

FreeBassX
07-09-03, 18:58
In your zone file on the MASTER nameserver you would add the following <to the existing record>:

sheep CNAME i-sleep-with-dead-animals.com.
drons CNAME i-sleep-with-dead-animals.com.
hinch CNAME i-sleep-with-dead-animals.com.

It will take about 24 - 72 hours to propagate through the ROOT servers. Once this is done you'll be able to use "sheep.i-sleep-with-dead-animals.com", drons.i-sleep... ect as your addresses.

As for how to get them to redirect through specific sections of your website is rather easy, if you are using Apache. To get "sheep.i-sleep-with-dead-animals.com" to go to the /sheep directory, you would need to add a VirtualHost.

VirtualHost *
ServerAdmin webmaster@i-sleep-with-dead-animals.com
DocumentRoot /opt/httpd/htdocs/sheep
ServerName sheep.i-sleep-with-dead-animals.com
/VirtualHost

(There is supposed to be a lessthan and greaterthan sign around "VirtualHost *"and "/VirtualHost")

Hopefully this helps ya out, and I would recommend checking out Apache's doc site for further details in VHosting.

HarpoMa
07-09-03, 19:00
Damn to slow

FreeBassX
07-09-03, 19:21
:D

Also to further note:

The examples I've supplied are very BASIC, and nothing advanced.

Its up to you to decide how granular and how much fine-tuning you wanna do to your site.

Kazuko
07-09-03, 19:23
[edit] someone got it first :p

But needless to say by hand is one way to do it. There are several domain tools around aswell. Check freshmeat.net

Richard Slade
07-09-03, 20:02
This is just sick..
You know that, right?

Lexxuk
07-09-03, 20:15
Originally posted by FreeBassX

VirtualHost *
ServerAdmin webmaster@i-sleep-with-dead-animals.com
DocumentRoot /opt/httpd/htdocs/sheep
ServerName sheep.i-sleep-with-dead-animals.com
/VirtualHost

VirtualHost has to go into httpd.conf doesnt it? I dont have access to that bit, just the cname.

Its set up..

Left Field - Hinch
Type - CNAME
Pri -
Right Field - i-sleep-with-dead-animals.com

That sets up the hinch.i-sleep-with-dead-animals.com, or indeed, anywhere, its just the virtual hosts thing, can it do into a .htaccess at the /htdocs/ root?

(edited lots to make it pretty)

FreeBassX
07-09-03, 20:25
Oh sorrry.. Ya, VirtualHost is meant to go into httpd.conf

**Sips first cup o java**

FreeBassX
07-09-03, 20:34
Originally posted by Kazuko
[edit] someone got it first :p

But needless to say by hand is one way to do it. There are several domain tools around aswell. Check freshmeat.net

Ya, there is tons of GUIs and console based tool out there that can do the same work.

But, I'm a firm believer, that you should learn to do this stuff by hand, before using a tools. By doing so, you gain a further understanding of the application in use.

But, I'm biased.. :D **Pulls out Slackware 1.00beta floppies**

Kazuko
08-09-03, 02:52
I'm all for knowing how something works too, especially when you have time to mess around with something. However, a tool can give you more insight into how to do something, get it done.. and done well. Then just take a look at the finished config.

FreeBassX
08-09-03, 05:58
So can HOWTOs, manuals and books..