0

Background information.

I have a server (running Debian Wheezy and Apache 2) at which I am to set up several Virtual Hosts to allow students to host their own website for development purpose. I am facing the simple option (from what I know) to host each site on a different port, making the students access their sites like this:

192.168.1.2:80
192.168.1.2:81
192.168.1.2:82

Where 192.168.1.2 is the server's local IP and :80-:82 is the ports hosting the different sites.

Although this is an approach that works out what I am actually trying to do, I think that something name based would be much more intuitive. One option is using the router's local domain name, I am not sure of how it works and I haven't got around to implement it successfully. If that worked, they could acccess their sites like this:

development.group.com:80
development.group.com:81
development.group.com:82

Where development is the server's hostname and group is the router's local domain name (DNS suffix).

What I would like to do, something that would be even more intuitive is to let each user have their own domain name (without actually having/owning one, of course). Example of how that would look:

www.exampledomain.com
www.exampledomain2.com
www.exampledomain3.com

I am thinking of implementing it by running my own DNS server, telling the router to use that DNS server and make each site hosted on the various domains.

Question.

I am not quite sure of how I could do that, so I guess the real question is: is there a best / better way of doing this and if not, how do I set up a DNS server (on the same server as the apache one) and make it reroute to the sites hosted by me?

Alex
  • 173
  • 1
  • 4
  • possible duplicate of [How to use DNS/Hostnames or Other ways to resolve to a specific IP:Port](http://serverfault.com/questions/74362/how-to-use-dns-hostnames-or-other-ways-to-resolve-to-a-specific-ipport) – HBruijn Dec 03 '14 at 11:20
  • @HBruijn That question does not include how one would go about and implement this without actually having the domain names. (Spoofing/faking domain names) Neither does it question what way is "the way". It answers that DNS cannot be used to forward to a port, but not much else. – Alex Dec 03 '14 at 12:19
  • If you can't control the DNS server your users are assigned and therefore can't create classroom domains: the registration of a real domain is nowadays a single digit $/€ amount. Then use subdomains like www.studentN.example.edu. – HBruijn Dec 03 '14 at 12:41
  • I can control the DNS, I have full access to the network router and the server. The server's DNS can be pointed to the Server, but the question is what should be on the recieving end? – Alex Dec 03 '14 at 12:43
  • HowTo set a DNS server is not really on topic here. A really trivial DNS server that take the syntax of /etc/hosts as a basis and works as a forwarder for everything else is [dnsmasq](http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html) – HBruijn Dec 03 '14 at 12:47
  • @HBruijn After some further reasearch, dnsmasq (using only as DNS) should solve my problem. I will test it later, thanks. – Alex Dec 03 '14 at 12:56

0 Answers0