Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am totally new to the DNS and server hosting world and not quite sure what I need.

I want to get a domain, forward it to my own server, so that the user sees example.com in the url bar and example.com/foo/bar will work. Depending on what subdomain it is, it should do different things (another base-directory at webserver, ftp, etc). Also my email should be able to be sent to and received by that server.

What irritates me, is the fact, that in the A-record I can only list IP-addresses and no ports. So do I have to set up a nameserver on my own server? Or do I accomplish this via vhosts on my webserver?

I would appreciate any help or link to a tutorial.

I know how DNS works, know some basic apache-stuff, etc... so no need to explain that.

Thanks

share|improve this question
    
thanks to everyone for the fast reply! –  ShoX May 17 '10 at 19:02

3 Answers 3

up vote 2 down vote accepted

you don't need to run your own DNS server, unless you want to play with it. most domain registrars allow direct control over your domain's dns records through their web interfaces, and so forth.

as far as hosting multiple subdomains, that's pretty easy with apache's VirtualHost directives. you just create a virtualhost with a ServerName of subdomain.example.com and set the DocumentRoot for that subdomain to be whereever on your file system

example of name-based virtual hosts in apache:

<VirtualHost *:80>
  DocumentRoot /var/www/domainx/htdocs/
  ServerName subdomain.example.com
  ServerAlias *.subdomain.example.com
  ...
</virtualHost>
share|improve this answer
    
thank you, perfectly solved my question! –  ShoX May 17 '10 at 19:01
    
excellent, glad i could help –  cpbills May 17 '10 at 19:04

It helps to remember the OSI model:

IP Address - Layer 3 - Network layer - Identifies the host
TCP Ports  - Layer 4 - Transport Layer - Identifies the process

At least at the present time, DNS only maps a human convenient name to a particular host, i.e., IP Address. The TCP Ports was supposed to be handled by Well Known Ports.

share|improve this answer

You set an A record to point to your server, there is no need for ports. Port 80 is the default web server port, so if you type http://yourdomain.com/ it will send the request to yourdomain.com on port 80.

share|improve this answer
    
What if he wants to send it to ANOTHER port? –  Satanicpuppy May 17 '10 at 19:21
    
Then like everyone else, he has to add the port to the request. –  Mitch Dempsey May 17 '10 at 19:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.