Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Can a DNS record point to an address like

share|improve this question

4 Answers 4

up vote 30 down vote accepted

DNS records only map IP addresses to hostnames so in a word, no

You could, however, use a hostname configuration in your web server to serve a subdirectory when a request comes in. Like having redirect/equate to That would depend on your web server software, not DNS.

share|improve this answer
Thanks, so for Apache I can edit the apache2.conf file I assume – Hannes de Jager Jul 28 '09 at 19:26
In apache, specifically, you would use the VirtualHosts feature. – Scott Pack Jul 28 '09 at 20:04

CNAME records are part of the Domain Name System, the naming system for the internet. Their only purpose is to translate host names, like into IP addresses. You can't attach folder names or queries to a CNAME. To be precise, CNAME resolve into other names, which themselves can be A-Records pointing to IP addresses or other CNAME records.

Your example or better A URI, a Uniform Resource Identifier which is used todentify or name a resource on the Internet - in your case a HTTP resource.

So, a workaround could be to define a CNAME to a different host header, which redirects to your folder using the HTTP status response 301 ("moved permanently"):

-> Browser requests 
-> Server sends a HTTP status code 301 to the browser:

All web servers and web programming languages provide commands for these types of redirects.

share|improve this answer

What you're asking for is a URL redirect. A CNAME record will NOT accomplish this.

Your easiest bet would probably be to either use an .htaccess file or (even easier) just write a quick web page with a meta refresh or a javascript redirect to automatically redirect the user.

You didn't mention your OS or web server so I'm just trying to provide the best generic answer I can.

share|improve this answer
Thanks I'm using Apache on Ubuntu – Hannes de Jager Jul 28 '09 at 19:25

No. CNAME records can only point to DNS records. You're looking for a HTTP redirect.

share|improve this answer

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.