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.

Some domain registry like europeregistry.com 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 http://redirected.example.com 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

3 Answers 3

up vote 5 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
    
...no. 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 help.dnsmadeeasy.com/record-entry/http-redirection –  cjc Apr 24 '12 at 9:57
1  
...no. 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
1  
It was necessary for the OP. –  adaptr Apr 24 '12 at 12:01
1  
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 "redirect.example.com" will return a CNAME that says "example.hostingservice.com", 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: http://help.dnsmadeeasy.com/record-entry/http-redirection/

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 http://redirect.example.com to something like http://example.hostingservice.com. The DNS for "redirect.example.com" 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 http://redirect.example.com to http://example.hostingservice.com.

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
1  
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:

yoursite.example.com. IN CNAME www.example.org.

www.example.org. IN A 10.10.10.10

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

 
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.