Different hostname to ip resolving results (nslookup)

dns-lookupdomain-name-systemnslookupresolvevirtualbox

Good day, everyone.
Let's say I have a following setup:

  • Windows 7 as host machine, DNS 192.168.0.100, 8.8.8.8, 8.8.4.4
  • Ubuntu 16.04 as guest machine on VirtualBox, DNS 192.168.0.100 (host?)

Ubuntu is connected to Windows's network via VirtualBox's NAT.

When I'm performing nslookup google.com, the results are totally different.
On Windows I see 6 x 172.xxx.xxx.xxx while on Ubuntu I see 6 x 62.xxx.xxx.xxx

So I guess even if I resolve google.com locally on my "router" machine on my network to block it from users, if a user has custom DNS server on its machine, they'll resolve another IP addresses? Any solution for that except forcing them using my DNS server?

Best Answer

Many DNS providers are using anycast to respond with the "best" result depending on where on the Internet the query is coming from.

Executing the same query on multiple DNS servers located in various parts of the world therefore will commonly result in different results. This is normal, and it helps with, among many other things, routing traffic to the closest caching server.