Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to redirect a sub-domain off my main domain r.example.com to another server. From what I've found so far, I can do this by simply adding a new line to the DNS file, like so:

r               14400   IN      A       1.2.3.4

but that doesn't make much sense to me (I would think you'd have to specify name servers somehow).

How would I go about properly sending this single sub-domain to another server so that the user on the other end can adequately grab it and use it for their website? I know the three name servers for where I want to point it too, but can't find how to do this. Is it even possible to treat a sub-domain as basically another domain with a DNS configuration, or would I possibly need to do this higher up with my domain provider?

share|improve this question
add comment

3 Answers 3

up vote 4 down vote accepted

"A" record alone defines host and not name server.

If target name servers already have their domain names in another domain, you do

r               14400   IN      NS       ns1.thatdomain.net.
                14400   IN      NS       ns2.thatdomain.net.
                14400   IN      NS       ns3.thatdomain.net.

Or, if you want to define new domain names for those servers, you do

r               14400   IN      NS       ns1.r.example.com.
                14400   IN      NS       ns2.example.com.
                14400   IN      NS       whatever.whatever.example.com.

ns1.r           14400   IN      A        1.2.3.4
ns2             14400   IN      A        5.6.7.8
whatever.whatever 14400 IN      A        9.0.1.2

For ns1.r (if you do it this way) you need to setup A record on the target servers too (because it's part of r.example.com and handled there), for all the rest - A record here is enough (because they belong here and not to r).

Correct name for this setup is not redirection but delegation.

share|improve this answer
    
Don't forget the "." at the end of the name servers. This worked perfectly. –  animuson Nov 28 '11 at 17:58
add comment

What you are creating is a third level domain. This should help a bit. DNS just converts the IP address computers talk into names humans can use easily. The reason you don't have to specify the NS server is pretty simple. You have already specified them for example.com. r.example.com is just pointing to a different IP address.

share|improve this answer
add comment

I believe you have done the correct step. If you believe you have setup an "A" dns records to redirect to some_IP, what is the problem you experience now?

If you have setup the "A" dns record, have you tried to ping r.example.com? Did you see the exact IP Address with the one you setup on "A" dns record? If it is the same, it should work

share|improve this answer
add comment

Your Answer

 
discard

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.