0
votes

I've been reading up a lot about DNS lately and have even searched on stack overflow for information, but I can't seem to find this. Please correct me if there's mistake along the way.

Assuming that I want to go to example.com. The way I understand how DNS works is that

  1. It looks on the local client machine for a cached record. If the cache has the record, everything's good. If it doesn't, it moves to step 2.

  2. Makes a request for the domain name to DNS resolver provided by Internet Service Provider (ISP).

  3. If DNS resolver has the domain name record cache, the IP Address is returned and all is well. If it doesn't, it moves to step 4.

  4. DNS resolver uses the DNS Root server hints file to request Root Servers to resolve the appropriate nameserver for Top Level Domain (TLD) (ie: .com, .net, .io).

  5. The request then gets passed down to the TLD server, in this case, responsible for .com. TLD servers have records of nameservers that could resolve "example" called authoritative servers.

  6. The authoritative server then has a record of "example" and returns the IP address to the ISP DNS resolver, who caches that record and returns it to the client who will also cache that record.

My question is lets assume I am typing in "example.ca", but the actual name should be example.com/ca since example.ca does not exist, how does DNS figure out that example.com/ca is the correct entry assuming that neither the local machine nor the ISP DNS resolver has this record cached?

1
What you described in your last sentence is not something that normally happens, DNS will not "figure it out". If you experienced it, then only if you provide real domain name we can maybe find out how that happens. - Dusan Bajic
Yeah, that’s what I thought too! It’s like black magic. The real domain name I was trying to access is Netflix.ca - Alex

1 Answers

1
votes

There is no black magic, and it does not have anything to do with DNS: there is a webserver running on http(s)://netflix.ca, and all it does is serve a redirect to https://netflix.com/ca