Sub Domains - newbie question

I work in a small community learning centre and have set up a server to host several web pages, these pages are purely for the students to look at/interact with (intranet)

I have been asked is it possible to add sub domains to one particular host, for example, we have a virtual host and would like each student to be able to have a sub domain,, etc

The intention is that they can then upload using ftp, a simple index.html page and view their handywork.

Hope that I have explained that clearly, forgive me if my jargon is incorrect, I am still learning and happy to be corrected!

Look forward to a response, many thanks


This wouldn’t really be a “subdomain”, but more like a folder in your main domain. :slight_smile:

You should be able to accomplish your goal by creating the proper directories, and then creating “Website FTP Access” users in Virtualmin, “Edit Users”, and giving them the proper subdirectory of your public_html as their home directory.

I haven’t tested this myself yet though, so you might just want to try it and see if it works. :slight_smile:

You’d also want to go to “Limits and Validation -> FTP Directory Restrictions” and “Restrict users to home directories”, otherwise they’d be able to browse the whole filesystem.

If you want actual subdomains, like “”, you’d need to go a different route. I’ll explain more if that’s what you’re after.

Hi Locutus,

I appreciate that “subdomain” is not the correct term, however I am trying to make the end product look and behave as “real” as possible. ie when a student types in it takes them to their own homepage.

I know I can create virtual users for each student, that is simple enough. However the problem I had with that was the address was not recognised, I had to go into windows/system32/drivers/etc/host and add the IP and address. Ok for one machine, I have 45. Secondly I would have to do this each time a new student joined and again on each machine.

Maybe what I am after is just not possible?

Thanks again


If your client machines cannot resolve “” with their regular DNS server settings and you need to make a hosts entry, there’s something wrong with the DNS zone on your server.

I just did some tests, and it does not seem that “” is an officially registered domain name. You’d either have to do that, and point the registrar nameservers to your server, or add your server’s IP as primary nameserver to all your client machines. Both those two options have further implications though which I cannot advise about without a lot of further information about your network setup.

Main question here is, is “” supposed to be a domain name only for your internal use, or should it be available on the internet?

You don’t need to do anything domain-wise “each time a new student joins” though, because only the “” part is a hostname that needs DNS resolving. the “/student1” part is just a directory on the webspace. Once the hostname is resolved, you can request anything after it, be it “/student1”, “/student1337” or “/blah/abc/def”.


Sorry for not making myself very clear. the domain is for internal use only, I used the term intranet, probably not the correct term. We are not allowed to use the server for the internet. The domain is a fictitious site, purely for the new students to familiarise themselves with the workings of the internet. I will at a later stage, as the students progress, be showing them how to upload to “their own space” hence my use of the word subdomain. The long term plan is that we will purchase a domain and give the students sub domains on it, but that is a long way of yet.

So, all I need to do is create a directory for each student? The DNS resolving I have done by adding the server’s IP as primary nameserver to all the student machines. That works I know. I have tried adding directories for each student, but I am obviously missing something because I cannot get it to work. I will keep plugging away at it though, bound to get there in the end!

Many thanks for your time, patience and clarity of answers, very much appreciated.


Please elaborate “I cannot get it to work”. That’s not a problem description. :wink: What exactly did you try and what exactly happened?

Yes, you basically just need to create the student subdirectories, then create the student users with the proper home directory, change the owner of the subdirectory to the newly created student user (otherwise they don’t have access rights), and don’t forget to set the “restrict to home directory” FTP option as I mentioned.

Quite right, a rubbish description and I should no better. I should have said I get a Not Found message. So obviously I knew I had done something wrong.

I had created New Users on the server and changed their root to where I thought it should be, aquagrim.coms /home/. I could get to the aquagrim home page, but when I added the /student1 I was getting the Not Found message.

From what you have posted previously I am certain I can finally sort this out. I am off work today, so will try again tomorrow.

For all the frustration, I am still enjoying doing this, it is a learning curve, steep at times but rewarding.

Your advice and support is, as I have mentioned previously, welcome and appreciated.

Kind regards