1

I'm fairly new to DNS server software. Currently I'm not using virtual hosts, but I am using dynamic sub-directories for my Users. Sometime in the future I would like my Users to be able to use their own domain name.

Is it possible to configure a DNS server to direct a domain name to a specific folder in a server directory?

If so, how?

user81536
  • 147
  • 4

1 Answers1

3

Simply put: No.

More elaborately put: No, you cannot link to any part of a path via DNS. Quite simply, DNS links domain names to IPs (or to other domain names), and has no ability to link to subdirectories at all.

One thing you might consider is a wildcard DNS entry; how you go about creating that is dependent upon your DNS provider, but it usually takes the form of an A or CNAME record of the form *.example.com. You can then use a default vhost in Apache (or nginx, or I'm sure just about any other) to handle that domain name in any way you wish -- including providing a redirect from username.example.com to example.com/username, or serving customized content.

Kromey
  • 3,641
  • 4
  • 25
  • 30