4

I had an issue this week where the webhost altered my DNS settings, but the website, whether I typed in example.com or www.example.com would always resolve to www.www.example.com and I couldn't figure out why.

I resolved the issue, it did turn out to be a DNS record error.

But how do I troubleshoot this in the future?

I can use dig to resolve names to other names and IP addresses, but then there's a webserver that might be redirecting, rewriting the URL, etc. Working just within the browser, I couldn't tell if a particular direction was due to DNS or the webserver.

Is there a method that would allow one to trace the full series of transactions that take place between entering a URL and finally getting a web page from a site, capturing all the DNS queries and results, and all the webserver redirects?

  • "But how do I troubleshoot this in the future?" - You now have the experience to know what/where to check. ;) You can immediately see if the webserver is redirecting (in the browser) by the reported network traffic. To be honest, if a site was successfully resolving to www.www.example.com then there would need to be something in DNS that allowed this to resolve to begin with. – MrWhite Feb 8 '15 at 1:30
8

Working just within the browser, I couldn't tell if a particular direction was due to DNS or the webserver.

To view webserver redirects in browsers, open up Developer Tools (either from the browser's menu, or by pressing F12), and click on the Network tab. It's a good idea to look for a Disable Cache option and check this so that all requests are done from the server instead of from local cache.

Then type in a URL, like google.com. As you can see in a screenshot of the Network tab in Firefox's Developer Tools below, a waterfall of requests from the browser to the server is displayed:

enter image description here

(To view this image in more detail, right click to open it in a new tab)

The first request is to the URL you typed in, which in this case is the root domain google.com. If you look at the left side under the Method column, you'll see a 301 redirect (circled) was made to www.google.com in the next row (also circled).

For your situation, if you typed in example.com as the URL, if the server was redirecting the client browser to another location, you'd see the HTTP server status code there, for example to www.www.example.com. If you don't see it there, then it's occurring in the DNS lookup by the browser prior to making the first request from the server.

In that case, you can confirm if a DNS record is pointing to another host (e.g., www.www.example.com) by doing a DNS Lookup for that host name (example.com) using any number of different online DNS lookup sites, or log into your DNS provider and look at the DNS Zone File to see where it points to.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.