2

Here's what I get when I ping facebook.com (the domain name) and www.facebook.com (host name of host machine)...

enter image description here

enter image description here

According to https://superuser.com/a/59094/325893, the domain name (facebook.com) is used to get to the network, and the host name (www.facebook.com) is used to get to the specific machine on that network. So shouldn't the beginning part of the host machine's IP address be the same as the domain's IP address, e.g., 173.something.something.something at the very least? Why is it completely different (31.13.65.33)?

Thanks!

Niko Bellic
  • 1,382

1 Answers1

7

Unfortunately, the answer referenced is inaccurate, or at least misleading.

There is no requirement for any part of a FQDN to have any relationship to any other part of the FQDN.

So the A records (the primary records that resolve to IP addresses) for .com, facebook.com, www.facebook.com, flibble.facebook.com just.another.domain.name.in.facebook.com can all resolve to different IP addresses on different servers in different networks.

Whats more, in the case of facebook and many other large websites, there is no single server that is at the end of a DNS resolution. Each domain entry may resove to any one of hundreds of servers with hundreds of IP addresses throughout the world.

So the resolution of facebook.com could be to an IP address for a server that is on the other side of the world to www.facebook.com (though it is likely both would be in your geographic locale).

Paul
  • 61,193