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'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?

share|improve this question

migrated from stackoverflow.com May 9 '11 at 19:56

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
It maps domain names to IP addresses. "IP" stands for "Internet Protocol", remember. –  JdeBP May 16 '11 at 13:31

Your Answer


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.