Common confusion between DNS and web configurations

There is always confusion about what DNS does and what it doesn’t do. In particular, I see constant reference to DNS functions mixed up with web server functions, and vice-versa. Hopefully this post clarifies things a bit to separate what DNS does and what web servers handle.
DNS is a fairly simple system. It is intrinsically critical to the Internet, being the phone book for the Internet world. If you want to find a website, the first thing your computer does is consult DNS. It finds the name based on the hierarchical nature of DNS separated by the .’s in the hostname.
A website URL has many pieces of information, even in common every day use. A URL such as
has 3 different pieces of data:
- https is the protocol used to get access to the service.
- The second is the hostname of the server to get data from contained between the /’s.
- The data after the hostname and slash tells the web server what specific data you are looking for.
There could be more slashes, other odd characters, or even more advanced parts to a URL that I won’t get into here. The main point is that we have the protocol, the hostname, and we have web server data; three parts melded into one URL.
At the simplest levels, what DNS returns after looking up a hostname in the directory, though, is just a number. Much like a phone #, the number is the Internet address of the web server that should handle your request. Your computer connects to this web server, presents the rest of the URL for processing and gets the data you are looking for.
One very common misconception is that DNS gives you more data than a number. Specifically many people assume web server data, such as more web server URL data, is inside DNS A records as well. Only numbers are ever returned inside a DNS A (or AAAA for IPv6) record (what your computer is looking up for visiting a web site). Anything after the hostname in the URL is only handled within the web server itself.
We get requests all the time to set up a website “redirect” within DNS. This can’t be done. DNS hostnames can be pointed to web servers, but not with extra data that isn’t just a number (an Internet address). That extra data needs to be configured inside a web server somewhere.
Unfortunately, many people do believe that this can be done because a few web companies have set up magic systems to make it seem like it is part of DNS. But what their magic is doing is running up yet another web server somewhere, handling the web request, and the web server gives out more results to go back to somewhere else. Since many DNS service companies run out of the country, your web site visitors end up getting bounced around the globe chasing down the proper web server in the end. Usually this works, but there is delay and processing (or latency) while the requests are handled off in Australia or Europe. If that web server redirect server is down, so is your site, because you depend on somebody else having the correct configuration while being up and available.
It is better to configure your web server locally to properly handle different domain names you may have instead of having magic redirects bouncing your customers around the globe. That way all your requests stay local and nobody else can intercept your web visitor to somewhere else due to a misconfiguration (or potentially nefarious activity). Response time will be quicker (latency again) since you’ll handle the request directly off your server instead of the visitor going to different offsite servers and then finally back to your server with the correct URL you wanted in the first place.
Finally, you don’t have to keep track of who does what function. I have seen redirect chains more than 5 levels deep as nobody knows any longer what was set up, what goes where, or how to troubleshoot such a complex setup. They build up over the years with different designers doing something a bit different with each revision.
With all your domainname/URLs configured in the web server to properly handle each one, it is all in one place, one response, and updates are easily handled without chasing it all over.

