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

I have a domain registered, say for example, I want to be able to send to a certain page on my server and to go to another page. Can anybody tell me how I can get and to resolve in dns? I presume that I have to get some sort of DNS forwarding working so that once the request reaches, and will be handled by my machine.

share|improve this question

migrated from Oct 25 '09 at 21:01

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

I believe this type of questions are best asked on (Stackoverflow is merely about programming). Perhaps someone with more editing rights can move the question for you. – Abel Oct 25 '09 at 20:58

3 Answers 3

Two things to do.

First, since you own, you are the official registry and DNS site for all subdomains, unless you explicitly configure your DNS to send them elsewhere. Hopefully, your server also hosts the authoritative DNS for your domain, in which case the easiest way to create a subdomain, is to add another A record for it.

For example, you have a DNS configuration with something like this in it:

www IN A

And that is what defines as the web server for Now you want to send requests for to the same web server. Simples!

www.fred IN A

is all that you need. Of course, many books will tell you that you need to set up another zone with its own SOA and set up NS records to point to it, but the fact is that if the only purpose of the subdomain is to run another website, it is easier to do the above.

Now for the second thing, and that is harder for me to explain in detail since you tell us nothing about your web server software. What you need to do is to configure the web server software to handle virtual websites based on virtual domains, often referred to as name-based virtual hosting.

This vhost tutorial for Apache explains what you need to setup in the Apache configuration. For IIS, you can create a virtual host website from the command prompt or you can do it through the GUI.

Note that a name-based virtual host cannot generally be used for SSL secure hosting, although there are ways around the restrictions. If you really need this capability, I suggest that you ask it as a separate question.

share|improve this answer

You need to make the subdomain resolve to your server and tell your server what to serve for the subdomain.

The exact procedure to change the DNS will depend on your nameserver, but you need to add a CNAME from sub to @.

You then need to add a web site to your web server.

Which web server are you using? Apache? IIS?

share|improve this answer

you need to configure dns and web server.

dns so that all requests to subdomains will go to

and web server to dispatch on http host

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.