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,162
  • 3
  • 13
  • 20

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
  • 59,223
  • 18
  • 147
  • 168
  • Thanks for the clarification. FOLLOWUP QUESTION: Is it possible that facebook.com resolves to a different IP address for me than it does for you? Let's say you are in India and I am in the USA. Would Facebook have a server hosting the website closer to your geographical area to reduce latency? Or is that "illegal" according to DNS/IP rules? – Niko Bellic Aug 11 '14 at 20:53
  • @NikoBellic Yes it is entirely possible and common with large websites. However, it is also entirely possible that I could be sitting next to you and get a different IP address to you. – Paul Aug 13 '14 at 13:00