Mobile app version of vmapp.org
Login or Join
Steve110

: How do I determine if a redirection was due to DNS or the webserver? I had an issue this week where the webhost altered my DNS settings, but the website, whether I typed in example.com or

@Steve110

Posted in: #DnsServers #Redirects #Webserver

I had an issue this week where the webhost altered my DNS settings, but the website, whether I typed in example.com or example.com would always resolve to 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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Steve110

1 Comments

Sorted by latest first Latest Oldest Best

 

@Gloria169

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:



(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 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.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.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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme