Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Some domain registry like allows users to buy and register a domain and set up a "redirection" to an existing website.

Is this redirection a function of DNS or has the registry setup a behind-the-scenes webserver that does a HTTP redirection to the specified website?

share|improve this question
This can be confirmed using a network sniffer like tcpdump or wireshark. Just run it and request your website and see if you are getting any HTTP redirect responses. – Khaled Apr 24 '12 at 9:30
For that matter, do something like curl -Iv and you'll see the connection to the IP address of the redirection provider run by the DNS service, followed by a 301 to whatever that is set to point at. Obviously, this only works with HTTP requests, but that may be all you care about. – cjc Apr 24 '12 at 9:48
up vote 6 down vote accepted

It's a behind-the-scenes thing that they do. They will register the domain, point it to their own *web*servers, and have very simple script that checks the incoming domain, looks it up in its database to see which site it should redirect to, and gives you a 301/302 redirect.

So it's actually three different things all working together.

share|improve this answer Where did HTTP come in ? – adaptr Apr 24 '12 at 9:30
Yes, actually. This is a particular service with some DNS providers. It's for people who don't want to (or can't) muck with their own web servers to do the 301. For example, we have a bunch of internal sites that run on Heroku, but we don't feel like paying for the "SSL on custom domain names". So, we set up simple names with the DNS provider to do the HTTP redirect to the Heroku URL. Look at – cjc Apr 24 '12 at 9:57
1 refers to the fact that in the above answer, HTTP suddenly appears from nowhere. That's not an explanation. – adaptr Apr 24 '12 at 11:44
It was necessary for the OP. – adaptr Apr 24 '12 at 12:01
I don't think it was at all: "or has the registry setup a behind-the-scenes webserver that does a HTTP redirection to the specified website?" Clearly he understood where the 301/302 would come from, as he described the setup in the question itself. – gparent Apr 24 '12 at 14:06

How about this for a complete answer:

DNS has the concept of a CNAME record, where an entry can point to a different entry, as per adaptr's answer. So, a DNS lookup of "" will return a CNAME that says "", which will subsequently be looked up to some A record with an IP address (with perhaps more levels, if the target of a CNAME is also a CNAME, etc.) This is a standard part of DNS.

Some DNS providers, but not all, will let you create a non-standard "HTTP redirect" record. For example:

This non-standard record appears to be what the OP refers to, and is geared towards hosted web sites, where it may not be possible to set up custom domains to your liking. What happens is that the "HTTP Redirection" record let's you map the website to something like The DNS for "" actually resolves to a server run by that DNS provider. That server runs a specialized web server, that will issue an HTTP redirect so that the browser goes from to

A couple things get mixed up in this: there's a DNS query that resolves to a machine controlled by the DNS provider. There is an HTTP response from that machine's web server which sends people off to a different web server. This is not purely DNS, and, in fact, only works for web services because of the HTTP redirect. You can't use this for, say, mail. This is entirely for people who don't want to (or can't) set up their own web server to issue the HTTP redirect themselves. My example would be, say, an expensive SSL certificate for a custom domain on Heroku. Instead of paying for that, the DNS provider can give us a "HTTP redirect" record for an easy-to-remember hostname. Hitting that easy-to-remember hostname in a web browser will send us to the hard-to-remember Heroku server running SSL.

share|improve this answer
Indeed. And the full reality is a bit too dense for a simple SF Q&A session - it requires knowledge spread across half a dozen fields. – adaptr Apr 24 '12 at 14:16
+1 thanks for the full explanation, but I personally preferred Mark's answer. – Jake Apr 25 '12 at 1:11

When talking about pure DNS, they are referring to a CNAME record; a CNAME points to another label, which has to be resolved anew (hence "redirection") by the client.

Example: IN CNAME IN A

There are both pros and cons to using CNAMEs; primarily, it forces a second lookup.

share|improve this answer
for that matter, I think we cannot CNAME the @ host, so I suspect it's not DNS. – Jake Apr 24 '12 at 10:01
True; I answered the question, not the confused babble underneath. – adaptr Apr 24 '12 at 11:45
@adaptr did you miss the 2nd paragraph where Jake asks if there's any HTTP redirection? You cannot do a redirection with DNS. A cname is not redirection. – Mark Henderson Apr 24 '12 at 11:50
The "babble" is called "the rest of the question". – gparent Apr 24 '12 at 14:08

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.